diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/skbuff.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 96cdcbe24ba2..bb7210f4005e 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -801,12 +801,10 @@ struct sk_buff *skb_pad(struct sk_buff *skb, int pad) | |||
801 | return nskb; | 801 | return nskb; |
802 | } | 802 | } |
803 | 803 | ||
804 | /* Trims skb to length len. It can change skb pointers, if "realloc" is 1. | 804 | /* Trims skb to length len. It can change skb pointers. |
805 | * If realloc==0 and trimming is impossible without change of data, | ||
806 | * it is BUG(). | ||
807 | */ | 805 | */ |
808 | 806 | ||
809 | int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc) | 807 | int ___pskb_trim(struct sk_buff *skb, unsigned int len) |
810 | { | 808 | { |
811 | int offset = skb_headlen(skb); | 809 | int offset = skb_headlen(skb); |
812 | int nfrags = skb_shinfo(skb)->nr_frags; | 810 | int nfrags = skb_shinfo(skb)->nr_frags; |
@@ -816,7 +814,6 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc) | |||
816 | int end = offset + skb_shinfo(skb)->frags[i].size; | 814 | int end = offset + skb_shinfo(skb)->frags[i].size; |
817 | if (end > len) { | 815 | if (end > len) { |
818 | if (skb_cloned(skb)) { | 816 | if (skb_cloned(skb)) { |
819 | BUG_ON(!realloc); | ||
820 | if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 817 | if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) |
821 | return -ENOMEM; | 818 | return -ENOMEM; |
822 | } | 819 | } |