brcmf: Fix null pointer exception in bcdc_hdrpull
authorPer Forlin <per.forlin@gmail.com>
Sun, 17 Apr 2016 13:25:03 +0000 (15:25 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 26 Apr 2016 09:18:37 +0000 (12:18 +0300)
In fwsignal.c: brcmf_fws_commit_skb()
...
if (rc < 0) {
  entry->transit_count--;
    if (entry->suppressed)
      entry->suppr_transit_count--;
      (void)brcmf_proto_hdrpull(fws->drvr, false, skb, NULL);
                                                     ^^^^^^^
    goto rollback;
}
...

The call to hdrpull will trigger a null pointer exception
unless a null check is made in the method implementation.

Signed-off-by: Per Forlin <per.forlin@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c

index 288fe90..d1bc51f 100644 (file)
@@ -321,7 +321,8 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
        if (pktbuf->len == 0)
                return -ENODATA;
 
-       *ifp = tmp_if;
+       if (ifp != NULL)
+               *ifp = tmp_if;
        return 0;
 }