Fairly trivial. The extra conditional should get optimized away with
current code. But it also allows to walk through network drivers and
get rid of the permanent
if (skb)
kfree(skb);
conditionals.
Jörn
--
Unless something dramatically changes, by 2015 we'll be largely
wondering what all the fuss surrounding Linux was really about.
-- Rob Enderle
Allow kfree_skb to be called with a NULL argument.
This allows slight simplification of many drivers.
Signed-off-by: Jörn Engel <[EMAIL PROTECTED]>
---
include/linux/skbuff.h | 2 ++
1 file changed, 2 insertions(+)
--- kfree_skb/include/linux/skbuff.h~kfree_skb_null 2006-02-22
08:42:22.000000000 +0100
+++ kfree_skb/include/linux/skbuff.h 2006-02-22 08:36:29.000000000 +0100
@@ -414,6 +414,8 @@ static inline struct sk_buff *skb_get(st
*/
static inline void kfree_skb(struct sk_buff *skb)
{
+ if (unlikely(!skb))
+ return;
if (likely(atomic_read(&skb->users) == 1))
smp_rmb();
else if (likely(!atomic_dec_and_test(&skb->users)))
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html