brcmfmac: Fix crash on cleanup.
authorHante Meuleman <meuleman@broadcom.com>
Tue, 30 Sep 2014 08:23:17 +0000 (10:23 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 30 Sep 2014 17:17:47 +0000 (13:17 -0400)
When driver gets unloaded due to error situation there is a chance
a packet gets received while fws has already been cleaned up. This
will result in kernel crash. This patch adds a check to avoid this
crash.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@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/fwsignal.c

index d42f7d04b65f115a6a370f2015015b6b03718b2a..183f08d7fc8c8e1ece4a6965fd604313385580f4 100644 (file)
@@ -1636,7 +1636,7 @@ int brcmf_fws_hdrpull(struct brcmf_pub *drvr, int ifidx, s16 signal_len,
        if (!signal_len)
                return 0;
        /* if flow control disabled, skip to packet data and leave */
-       if (!fws->fw_signals) {
+       if ((!fws) || (!fws->fw_signals)) {
                skb_pull(skb, signal_len);
                return 0;
        }