aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/udp.h')
-rw-r--r--include/net/udp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index cc8036987dcb..e9b1d1eacb59 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;