brcmfmac: fix potential NULL dereference
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Thu, 18 Oct 2012 10:10:56 +0000 (18:10 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Oct 2012 17:18:08 +0000 (13:18 -0400)
Fix a samtch warnings catched by Fengguang's 0-DAY system:
+ drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c:3572 brcmf_cfg80211_sched_scan_start() error: we previously assumed 'request' could be null (see line 3571)

Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

index 411dfe7c7ff050764547b9c5c35572a207a7786b..a6f1e81660085766ffbd2b38ae896566f0e9eb3c 100644 (file)
@@ -3569,7 +3569,7 @@ brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy,
 
        if (!request || !request->n_ssids || !request->n_match_sets) {
                WL_ERR("Invalid sched scan req!! n_ssids:%d\n",
-                      request->n_ssids);
+                      request ? request->n_ssids : 0);
                return -EINVAL;
        }