Skip to content

Commit

Permalink
net: skb_trim explicitely check the linearity instead of data_len
Browse files Browse the repository at this point in the history
The purpose of the check on data_len is to check linearity, so use the inline
helper for this. No overhead and more explicit.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Emmanuel Grumbach authored and David S. Miller committed May 23, 2011
1 parent c378a9c commit c4264f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);

static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
{
if (unlikely(skb->data_len)) {
if (unlikely(skb_is_nonlinear(skb))) {
WARN_ON(1);
return;
}
Expand Down

0 comments on commit c4264f2

Please sign in to comment.