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>
This commit is contained in:
parent
9a95e60e06
commit
53ee4bc467
1 changed files with 11 additions and 22 deletions
|
@ -41,28 +41,17 @@ 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;
|
if (skb->destructor)
|
||||||
|
/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
|
||||||
/* perversion: we use skb->next to chain multi-skb packets */
|
* destructor exists
|
||||||
while (skb) {
|
*/
|
||||||
nskb = skb->next;
|
dev_kfree_skb_any(skb);
|
||||||
skb->next = NULL;
|
else
|
||||||
|
/* can free immediately (even in_irq()) if destructor
|
||||||
if (skb->destructor)
|
* does not exist
|
||||||
/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
|
*/
|
||||||
* destructor exists
|
dev_kfree_skb(skb);
|
||||||
*/
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
else
|
|
||||||
/* can free immediately (even in_irq()) if destructor
|
|
||||||
* does not exist
|
|
||||||
*/
|
|
||||||
dev_kfree_skb(skb);
|
|
||||||
|
|
||||||
nest++;
|
|
||||||
skb = nskb;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(brcmu_pkt_buf_free_skb);
|
EXPORT_SYMBOL(brcmu_pkt_buf_free_skb);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue