All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] brcm80211: brcmu_pkt_buf_free_skb() should handle NULL
@ 2012-05-15  9:00 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2012-05-15  9:00 UTC (permalink / raw)
  To: Brett Rudley
  Cc: Roland Vossen, Arend van Spriel, Franky (Zhenhui) Lin, Kan Yan,
	John W. Linville, Greg Kroah-Hartman, Pieter-Paul Giesberts,
	linux-wireless, kernel-janitors

This is potentially called with NULL pointers, for example, look at
brcmf_c_prec_enq().  Since it's a free() function, probably people
expect it to handle NULL pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
index b45ab34..3e6405e 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
@@ -43,6 +43,8 @@ EXPORT_SYMBOL(brcmu_pkt_buf_get_skb);
 /* Free the driver packet. Free the tag if present */
 void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
 {
+	if (!skb)
+		return;
 	WARN_ON(skb->next);
 	if (skb->destructor)
 		/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if

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

end of thread, other threads:[~2012-05-15 16:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15  9:00 [patch] brcm80211: brcmu_pkt_buf_free_skb() should handle NULL Dan Carpenter
2012-05-15  9:00 ` Dan Carpenter
2012-05-15 14:21 ` Arend van Spriel
2012-05-15 14:21   ` Arend van Spriel
2012-05-15 14:28   ` Arend van Spriel
2012-05-15 14:28     ` Arend van Spriel
2012-05-15 14:44   ` Dan Carpenter
2012-05-15 14:44     ` Dan Carpenter
2012-05-15 15:07     ` Julia Lawall
2012-05-15 15:07       ` Julia Lawall
2012-05-15 16:57       ` Arend van Spriel
2012-05-15 16:57         ` Arend van Spriel

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.