diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 416a2e4024b21b082a573740052002e815e6bd10..fbcb18651970c982501953847676bdee58513924 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, { int hlen = skb_headlen(skb); - if (offset + len <= hlen) + if (hlen - offset >= len) return skb->data + offset; if (skb_copy_bits(skb, offset, buffer, len) < 0)