diff options
author | Arend van Spriel <arend@broadcom.com> | 2011-11-10 14:30:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 14:28:43 -0500 |
commit | 53ee4bc46784ad53d0a9be52e8d687dd4e89a055 (patch) | |
tree | 6cad8986e1c920431b2012e0a34804d5d0aa1c96 | |
parent | 9a95e60e0610bb8ec39c74d2c8546514a76428df (diff) |
brcm80211: util: remove pointer traversal from brcmu_pkt_buf_free_skb
The function brcmu_pkt_buf_free_skb() was following the next pointer
to free all linked packets. However, it is only called with unlinked
packets so this can be removed.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmutil/utils.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c index 3a92f72caef7..b7537f70a795 100644 --- a/drivers/net/wireless/brcm80211/brcmutil/utils.c +++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c | |||
@@ -41,28 +41,17 @@ EXPORT_SYMBOL(brcmu_pkt_buf_get_skb); | |||
41 | /* Free the driver packet. Free the tag if present */ | 41 | /* Free the driver packet. Free the tag if present */ |
42 | void brcmu_pkt_buf_free_skb(struct sk_buff *skb) | 42 | void brcmu_pkt_buf_free_skb(struct sk_buff *skb) |
43 | { | 43 | { |
44 | struct sk_buff *nskb; | 44 | WARN_ON(skb->next); |
45 | int nest = 0; | 45 | if (skb->destructor) |
46 | 46 | /* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if | |
47 | /* perversion: we use skb->next to chain multi-skb packets */ | 47 | * destructor exists |
48 | while (skb) { | 48 | */ |
49 | nskb = skb->next; | 49 | dev_kfree_skb_any(skb); |
50 | skb->next = NULL; | 50 | else |
51 | 51 | /* can free immediately (even in_irq()) if destructor | |
52 | if (skb->destructor) | 52 | * does not exist |
53 | /* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if | 53 | */ |
54 | * destructor exists | 54 | dev_kfree_skb(skb); |
55 | */ | ||
56 | dev_kfree_skb_any(skb); | ||
57 | else | ||
58 | /* can free immediately (even in_irq()) if destructor | ||
59 | * does not exist | ||
60 | */ | ||
61 | dev_kfree_skb(skb); | ||
62 | |||
63 | nest++; | ||
64 | skb = nskb; | ||
65 | } | ||
66 | } | 55 | } |
67 | EXPORT_SYMBOL(brcmu_pkt_buf_free_skb); | 56 | EXPORT_SYMBOL(brcmu_pkt_buf_free_skb); |
68 | 57 | ||