summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-11-03 18:17:31 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-12-05 14:34:32 -0500
commit0b62fca2623e4633c8819e89946d0da446a5846b (patch)
tree351ddba8eea1b9a6f62ee3fc3f51ba413d423a76
parent15e6cb46c9b09711d1224ae5418b53140e1ba444 (diff)
switch getfrag callbacks to ..._full() primitives
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--include/net/udplite.h2
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/ping.c8
3 files changed, 7 insertions, 7 deletions
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 80761938b9a7..59477d805145 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -20,7 +20,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
20 int len, int odd, struct sk_buff *skb) 20 int len, int odd, struct sk_buff *skb)
21{ 21{
22 struct msghdr *msg = from; 22 struct msghdr *msg = from;
23 return copy_from_iter(to, len, &msg->msg_iter) != len ? -EFAULT : 0; 23 return copy_from_iter_full(to, len, &msg->msg_iter) ? 0 : -EFAULT;
24} 24}
25 25
26/* Designate sk as UDP-Lite socket */ 26/* Designate sk as UDP-Lite socket */
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 105908d841a3..be4d149f0321 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -802,11 +802,11 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
802 struct msghdr *msg = from; 802 struct msghdr *msg = from;
803 803
804 if (skb->ip_summed == CHECKSUM_PARTIAL) { 804 if (skb->ip_summed == CHECKSUM_PARTIAL) {
805 if (copy_from_iter(to, len, &msg->msg_iter) != len) 805 if (!copy_from_iter_full(to, len, &msg->msg_iter))
806 return -EFAULT; 806 return -EFAULT;
807 } else { 807 } else {
808 __wsum csum = 0; 808 __wsum csum = 0;
809 if (csum_and_copy_from_iter(to, len, &csum, &msg->msg_iter) != len) 809 if (!csum_and_copy_from_iter_full(to, len, &csum, &msg->msg_iter))
810 return -EFAULT; 810 return -EFAULT;
811 skb->csum = csum_block_add(skb->csum, csum, odd); 811 skb->csum = csum_block_add(skb->csum, csum, odd);
812 } 812 }
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 205e2000d395..7dd7baf2a5ad 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -609,15 +609,15 @@ int ping_getfrag(void *from, char *to,
609 fraglen -= sizeof(struct icmphdr); 609 fraglen -= sizeof(struct icmphdr);
610 if (fraglen < 0) 610 if (fraglen < 0)
611 BUG(); 611 BUG();
612 if (csum_and_copy_from_iter(to + sizeof(struct icmphdr), 612 if (!csum_and_copy_from_iter_full(to + sizeof(struct icmphdr),
613 fraglen, &pfh->wcheck, 613 fraglen, &pfh->wcheck,
614 &pfh->msg->msg_iter) != fraglen) 614 &pfh->msg->msg_iter))
615 return -EFAULT; 615 return -EFAULT;
616 } else if (offset < sizeof(struct icmphdr)) { 616 } else if (offset < sizeof(struct icmphdr)) {
617 BUG(); 617 BUG();
618 } else { 618 } else {
619 if (csum_and_copy_from_iter(to, fraglen, &pfh->wcheck, 619 if (!csum_and_copy_from_iter_full(to, fraglen, &pfh->wcheck,
620 &pfh->msg->msg_iter) != fraglen) 620 &pfh->msg->msg_iter))
621 return -EFAULT; 621 return -EFAULT;
622 } 622 }
623 623