diff options
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index cc8036987dcb..586de4b811b5 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -366,12 +366,13 @@ static inline bool udp_skb_is_linear(struct sk_buff *skb) | |||
366 | static inline int copy_linear_skb(struct sk_buff *skb, int len, int off, | 366 | static inline int copy_linear_skb(struct sk_buff *skb, int len, int off, |
367 | struct iov_iter *to) | 367 | struct iov_iter *to) |
368 | { | 368 | { |
369 | int n, copy = len - off; | 369 | int n; |
370 | 370 | ||
371 | n = copy_to_iter(skb->data + off, copy, to); | 371 | n = copy_to_iter(skb->data + off, len, to); |
372 | if (n == copy) | 372 | if (n == len) |
373 | return 0; | 373 | return 0; |
374 | 374 | ||
375 | iov_iter_revert(to, n); | ||
375 | return -EFAULT; | 376 | return -EFAULT; |
376 | } | 377 | } |
377 | 378 | ||