Skip to contentSkip to conversation

brcmf: Fix null pointer exception in bcdc_hdrpull

PATCH Applied [email protected] 2 participants 2 messages Apr 17, 2016 – Apr 26, 2016 Broadcom BRCM80211 IEEE802.11 wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmf: Fix null pointer exception in bcdc_hdrpull

From: Per Forlin <[email protected]>

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.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +2 -1
index 6af658e..81727da2 100644
@@ -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;
 }
 
Signature · 1 line
2.1.4
Applied
#1 lore raw
Quoted 13 lines

From: Per Forlin <[email protected]>

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;
}
Quoted 6 lines

...

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

Thanks, applied to wireless-drivers-next.git.

Kalle Valo