From 2b496ca9c7c94230bfece3ec63f3b32ec9285d57 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 3 Aug 2012 20:54:15 +0000 Subject: [PATCH] --- yaml --- r: 327382 b: refs/heads/master c: 47061bc440b90a16d856fb0dba1cffc36427efa4 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/skbuff.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 356c1ba2e898..cfe195bfc78b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cc72d100a3f4ba42a9ad02ebe52c0c6c7c496267 +refs/heads/master: 47061bc440b90a16d856fb0dba1cffc36427efa4 diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index 7632c87da2c9..b33a3a1f205e 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -846,13 +846,16 @@ static inline int skb_shared(const struct sk_buff *skb) * * NULL is returned on a memory allocation failure. */ -static inline struct sk_buff *skb_share_check(struct sk_buff *skb, - gfp_t pri) +static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri) { might_sleep_if(pri & __GFP_WAIT); if (skb_shared(skb)) { struct sk_buff *nskb = skb_clone(skb, pri); - kfree_skb(skb); + + if (likely(nskb)) + consume_skb(skb); + else + kfree_skb(skb); skb = nskb; } return skb;