brcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()
authorWei Yongjun <[email protected]>
Fri, 19 Apr 2013 02:14:31 +0000 (10:14 +0800)
committerJohn W. Linville <[email protected]>
Mon, 22 Apr 2013 19:20:25 +0000 (15:20 -0400)
The dereference to 'ifp' in debug code should be moved below the NULL test.

Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Arend van Spriel <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c

index 8ae7da8bf688e9954eac4df1036623699bbbf01a..66cdc45add4e9c7851c549eed417fafcbb073a43 100644 (file)
@@ -834,11 +834,12 @@ brcmf_fws_flow_control_check(struct brcmf_fws_info *fws, struct pktq *pq,
 {
        struct brcmf_if *ifp = fws->drvr->iflist[if_id];
 
-       brcmf_dbg(TRACE,
-                 "enter: bssidx=%d, ifidx=%d\n", ifp->bssidx, ifp->ifidx);
        if (WARN_ON(!ifp))
                return;
 
+       brcmf_dbg(TRACE,
+                 "enter: bssidx=%d, ifidx=%d\n", ifp->bssidx, ifp->ifidx);
+
        if ((ifp->netif_stop & BRCMF_NETIF_STOP_REASON_FWS_FC) &&
            pq->len <= BRCMF_FWS_FLOWCONTROL_LOWATER)
                brcmf_txflowblock_if(ifp,