brcm80211: brcmu_pkt_buf_free_skb() should handle NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 15 May 2012 09:00:27 +0000 (12:00 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 5 Jun 2012 19:23:20 +0000 (15:23 -0400)
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>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmutil/utils.c

index b45ab34cdfdc0693676fae614359b2bafaa5c526..3e6405e06ac028687e1d12627874491e969d6e94 100644 (file)
@@ -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