Commit 16a1f736 authored by Wei Yongjun's avatar Wei Yongjun Committed by John W. Linville
Browse files

brcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()



The dereference to 'ifp' in debug code should be moved below the NULL test.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4fc4118c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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,