aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/skbuff.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 416a2e4024b2..fbcb18651970 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1211,7 +1211,7 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1211{ 1211{
1212 int hlen = skb_headlen(skb); 1212 int hlen = skb_headlen(skb);
1213 1213
1214 if (offset + len <= hlen) 1214 if (hlen - offset >= len)
1215 return skb->data + offset; 1215 return skb->data + offset;
1216 1216
1217 if (skb_copy_bits(skb, offset, buffer, len) < 0) 1217 if (skb_copy_bits(skb, offset, buffer, len) < 0)