Commit 53ee4bc4 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

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: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9a95e60e
...@@ -41,14 +41,7 @@ EXPORT_SYMBOL(brcmu_pkt_buf_get_skb); ...@@ -41,14 +41,7 @@ EXPORT_SYMBOL(brcmu_pkt_buf_get_skb);
/* Free the driver packet. Free the tag if present */ /* Free the driver packet. Free the tag if present */
void brcmu_pkt_buf_free_skb(struct sk_buff *skb) void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
{ {
struct sk_buff *nskb; WARN_ON(skb->next);
int nest = 0;
/* perversion: we use skb->next to chain multi-skb packets */
while (skb) {
nskb = skb->next;
skb->next = NULL;
if (skb->destructor) if (skb->destructor)
/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if /* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
* destructor exists * destructor exists
...@@ -59,10 +52,6 @@ void brcmu_pkt_buf_free_skb(struct sk_buff *skb) ...@@ -59,10 +52,6 @@ void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
* does not exist * does not exist
*/ */
dev_kfree_skb(skb); dev_kfree_skb(skb);
nest++;
skb = nskb;
}
} }
EXPORT_SYMBOL(brcmu_pkt_buf_free_skb); EXPORT_SYMBOL(brcmu_pkt_buf_free_skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment