brcmfmac: remove null-pointer check in .sched_scan_start() callback
authorArend van Spriel <arend@broadcom.com>
Sun, 3 Mar 2013 11:45:25 +0000 (12:45 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Mar 2013 21:28:37 +0000 (16:28 -0500)
In brcmf_cfg80211_sched_scan_start() the request parameter was checked
for being non-null. However, it never is so remove the check which gets
rid of following smatch warning:

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c:2904
brcmf_cfg80211_sched_scan_start()
warn: variable dereferenced before check 'request' (see line 2897)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

index 2af9c0f0798d9e5cc2e484b0599a7d50aede68e5..804473fc5c5ec0a495059b9a1b59d0213dc9897d 100644 (file)
@@ -3052,16 +3052,16 @@ brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy,
        int i;
        int ret = 0;
 
-       brcmf_dbg(SCAN, "Enter n_match_sets:%d   n_ssids:%d\n",
+       brcmf_dbg(SCAN, "Enter n_match_sets:%d n_ssids:%d\n",
                  request->n_match_sets, request->n_ssids);
        if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
                brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
                return -EAGAIN;
        }
 
-       if (!request || !request->n_ssids || !request->n_match_sets) {
+       if (!request->n_ssids || !request->n_match_sets) {
                brcmf_err("Invalid sched scan req!! n_ssids:%d\n",
-                         request ? request->n_ssids : 0);
+                         request->n_ssids);
                return -EINVAL;
        }