All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brcmf: Fix null pointer exception in bcdc_hdrpull
@ 2016-04-17 13:25 per.forlin
  2016-04-26  9:19 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: per.forlin @ 2016-04-17 13:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: arend, brudley, Per Forlin

From: Per Forlin <per.forlin@gmail.com>

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>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
index 6af658e..81727da2 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
@@ -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;
 }
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: brcmf: Fix null pointer exception in bcdc_hdrpull
  2016-04-17 13:25 [PATCH] brcmf: Fix null pointer exception in bcdc_hdrpull per.forlin
@ 2016-04-26  9:19 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2016-04-26  9:19 UTC (permalink / raw)
  To: per.forlin; +Cc: linux-wireless, arend, brudley, Per Forlin


> From: Per Forlin <per.forlin@gmail.com>
> 
> 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>

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

Kalle Valo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-26  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-17 13:25 [PATCH] brcmf: Fix null pointer exception in bcdc_hdrpull per.forlin
2016-04-26  9:19 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.