diff --git a/include/net/udp.h b/include/net/udp.h index cc8036987dcb885012c6c5eda0fb2bed2e588841..e9b1d1eacb59d0199f4af578e35113017d002a69 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -368,6 +368,8 @@ static inline int copy_linear_skb(struct sk_buff *skb, int len, int off, { int n, copy = len - off; + if (copy < 0) + return -EINVAL; n = copy_to_iter(skb->data + off, copy, to); if (n == copy) return 0;