summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-11-01 22:42:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-12-05 14:34:30 -0500
commit15e6cb46c9b09711d1224ae5418b53140e1ba444 (patch)
tree752327459c25e4d36f8523c571384857ec64a39f /include/net
parentcbbd26b8b1a6af9c02e2b6523e12bd50cc765059 (diff)
downloadlinux-15e6cb46c9b09711d1224ae5418b53140e1ba444.tar.bz2
make skb_add_data,{_nocache}() and skb_copy_to_page_nocache() advance only on success
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sock.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 92b269709b9a..5dd0fed82a06 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1783,13 +1783,13 @@ static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
{
if (skb->ip_summed == CHECKSUM_NONE) {
__wsum csum = 0;
- if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
+ if (!csum_and_copy_from_iter_full(to, copy, &csum, from))
return -EFAULT;
skb->csum = csum_block_add(skb->csum, csum, offset);
} else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) {
- if (copy_from_iter_nocache(to, copy, from) != copy)
+ if (!copy_from_iter_full_nocache(to, copy, from))
return -EFAULT;
- } else if (copy_from_iter(to, copy, from) != copy)
+ } else if (!copy_from_iter_full(to, copy, from))
return -EFAULT;
return 0;