6LoWPAN: use kfree_skb() instead of kfree()
Subsystems (4)
PATCH 1/3 6LoWPAN: use kfree_skb() instead of kfree()
Use kfree_skb() to free sbk_buffs.
net/ieee802154/6lowpan.c +1 -1
@@ -674,7 +674,7 @@ lowpan_process_data(struct sk_buff *skb) sizeof(hdr));return lowpan_skb_deliver (skb, &hdr); drop: -kfree (skb); +kfree_skb (skb);return -EINVAL ; }
Quoted 9 lines · Dan Carpenter
Use
kfree_skb()to freesbk_buffs.Signed-off-by Dan Carpenter <[email protected]>net/ieee802154/6lowpan.c +0
-0
net/ieee802154/6lowpan.c lowpan_process_data(struct sk_buff *skb) · line 680
Quoted 8 lines
net/ieee802154/6lowpan.c +1
-1@@ -674,7 +674,7 @@ lowpan_process_data(struct sk_buff *skb) sizeof(hdr));return lowpan_skb_deliver (skb, &hdr); drop: -kfree (skb); +kfree_skb (skb);return -EINVAL ; }
Another bug is the skb_copy() done in lowpan_skb_deliver()
1) No check of skb_copy() return
2.1) Use of GFP_KERNEL : Is it safe at this point ? Aren’t we in softirq ?
2.2) If GFP_KERNEL is safe, why do we later do :
if (in_interrupt()) stat = netif_rx(skb); else stat = netif_rx_ni(skb);
Hi Dan, Eric,
thank you a lot for the finds, that were my faults.
With best regards,
Alexander
2011/8/30 Eric Dumazet <[email protected]>:
Quoted 26 lines · Dan Carpenter
Quoted 11 lines
Use
kfree_skb()to freesbk_buffs.Signed-off-by Dan Carpenter <[email protected]>net/ieee802154/6lowpan.c +0
-0@@ -674,7 +674,7 @@ lowpan_process_data(struct sk_buff *skb) sizeof(hdr)); return lowpan_skb_deliver(skb, &hdr);Quoted 6 lines
drop:
- kfree(skb);
+kfree_skb(skb);
return-EINVAL;
}Another bug is the
skb_copy()done inlowpan_skb_deliver()1) No check of
skb_copy()return2.1) Use of
GFP_KERNEL: Is it safe at this point ? Aren’t we in softirq ?
Quoted 10 lines
2.2) If
GFP_KERNELis safe, why do we later do :if (
in_interrupt())
stat =netif_rx(skb);
else
stat =netif_rx_ni(skb);
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Alexander Smirnov
Hi Dan, Eric,
thank you a lot for the finds, that were my faults.
So uh... You're going to send a patch to fix the things Eric mentioned, right?
regards,
dan carpenter
Quoted 9 lines · Dan Carpenter
Quoted 4 lines · Alexander Smirnov
Hi Dan, Eric,
thank you a lot for the finds, that were my faults.
So uh... You're going to send a patch to fix the things Eric mentioned, right?
Ah. You did already. I see that now. Sorry for the noise.
regards,
dan carpenter
A message that is not in the archive (sent off-list or not yet received): 20110830134552.GH3705-z0WHZYlhLlzP0Z7Jsv878P8+0UxHXcjY@public.gmane.org
David Miller
AppliedFrom: Dan Carpenter <[email protected]>
Date: Tue, 30 Aug 2011 16:45:52 +0300
Quoted 3 lines
Use
kfree_skb()to freesbk_buffs.Signed-off-by Dan Carpenter <[email protected]>
Applied.