diff options
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7632c87da2c9..b33a3a1f205e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -846,13 +846,16 @@ static inline int skb_shared(const struct sk_buff *skb) | |||
| 846 | * | 846 | * |
| 847 | * NULL is returned on a memory allocation failure. | 847 | * NULL is returned on a memory allocation failure. |
| 848 | */ | 848 | */ |
| 849 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | 849 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri) |
| 850 | gfp_t pri) | ||
| 851 | { | 850 | { |
| 852 | might_sleep_if(pri & __GFP_WAIT); | 851 | might_sleep_if(pri & __GFP_WAIT); |
| 853 | if (skb_shared(skb)) { | 852 | if (skb_shared(skb)) { |
| 854 | struct sk_buff *nskb = skb_clone(skb, pri); | 853 | struct sk_buff *nskb = skb_clone(skb, pri); |
| 855 | kfree_skb(skb); | 854 | |
| 855 | if (likely(nskb)) | ||
| 856 | consume_skb(skb); | ||
| 857 | else | ||
| 858 | kfree_skb(skb); | ||
| 856 | skb = nskb; | 859 | skb = nskb; |
| 857 | } | 860 | } |
| 858 | return skb; | 861 | return skb; |
