summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-02-03 21:14:01 +0100
committerJohn W. Linville <linville@tuxdriver.com>2011-02-03 15:23:53 -0500
commit4d048aac990d587c81fc1002e28502e6f95371ee (patch)
tree97c20ca2497cee86d9abe5d5b4c88beb92080b5b /drivers
parent4334ec8518cec3f7a4feeb3dacb46acfb24904d4 (diff)
wireless, wl1251: Fix potential NULL pointer dereference in wl1251_op_bss_info_changed()
In drivers/net/wireless/wl1251/main.c:wl1251_op_bss_info_changed() we make a call to ieee80211_beacon_get() which may return NULL, but we do not check the return value before dereferencing the pointer. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl1251/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 012e1a4016fe..40372bac9482 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -1039,6 +1039,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_BEACON) {
beacon = ieee80211_beacon_get(hw, vif);
+ if (!beacon)
+ goto out_sleep;
+
ret = wl1251_cmd_template_set(wl, CMD_BEACON, beacon->data,
beacon->len);