summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSven Neumann <s.neumann@raumfeld.com>2010-12-09 09:38:36 +0100
committerJohn W. Linville <linville@tuxdriver.com>2010-12-13 20:53:46 +0100
commit4a55d5852adbe66722fb1636c82c7864cd5be441 (patch)
tree959097a4adcd191417e2f59b07cb404edc3b1854 /drivers
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padova... (diff)
downloadlinux-4a55d5852adbe66722fb1636c82c7864cd5be441.tar.xz
linux-4a55d5852adbe66722fb1636c82c7864cd5be441.zip
libertas: fix potential NULL-pointer dereference
The code wants to check if there's a channel and it is not disabled, but it used to check if channel is not NULL and accessed the channel struct if this check failed. Signed-off-by: Sven Neumann <s.neumann@raumfeld.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/cfg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 373930afc26b..113f4f204657 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -619,7 +619,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
print_ssid(ssid_buf, ssid, ssid_len),
LBS_SCAN_RSSI_TO_MBM(rssi)/100);
- if (channel ||
+ if (channel &&
!(channel->flags & IEEE80211_CHAN_DISABLED))
cfg80211_inform_bss(wiphy, channel,
bssid, le64_to_cpu(*(__le64 *)tsfdesc),