aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-06 21:51:23 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-11-24 04:28:51 -0500
commit7eab8d9e8a722ca07bc785f73e21c3d3418defa6 (patch)
treef42c78986668929d2a2b05d88c94a36dab7c1a36 /net
parente169371823827dae1fd1d15bceb0fe5497c1a5ba (diff)
new helper: memcpy_to_msg()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net')
-rw-r--r--net/caif/caif_socket.c2
-rw-r--r--net/can/bcm.c2
-rw-r--r--net/can/raw.c2
-rw-r--r--net/decnet/af_decnet.c2
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/irda/af_irda.c2
-rw-r--r--net/packet/af_packet.c3
7 files changed, 7 insertions, 8 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 230f14026c11..ac618b0b8a4f 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -418,7 +418,7 @@ unlock:
418 } 418 }
419 release_sock(sk); 419 release_sock(sk);
420 chunk = min_t(unsigned int, skb->len, size); 420 chunk = min_t(unsigned int, skb->len, size);
421 if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { 421 if (memcpy_to_msg(msg, skb->data, chunk)) {
422 skb_queue_head(&sk->sk_receive_queue, skb); 422 skb_queue_head(&sk->sk_receive_queue, skb);
423 if (copied == 0) 423 if (copied == 0)
424 copied = -EFAULT; 424 copied = -EFAULT;
diff --git a/net/can/bcm.c b/net/can/bcm.c
index b9a1f715df18..01671187e3fe 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1555,7 +1555,7 @@ static int bcm_recvmsg(struct kiocb *iocb, struct socket *sock,
1555 if (skb->len < size) 1555 if (skb->len < size)
1556 size = skb->len; 1556 size = skb->len;
1557 1557
1558 err = memcpy_toiovec(msg->msg_iov, skb->data, size); 1558 err = memcpy_to_msg(msg, skb->data, size);
1559 if (err < 0) { 1559 if (err < 0) {
1560 skb_free_datagram(sk, skb); 1560 skb_free_datagram(sk, skb);
1561 return err; 1561 return err;
diff --git a/net/can/raw.c b/net/can/raw.c
index 0e4004fb6876..dfdcffbb1070 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -750,7 +750,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct socket *sock,
750 else 750 else
751 size = skb->len; 751 size = skb->len;
752 752
753 err = memcpy_toiovec(msg->msg_iov, skb->data, size); 753 err = memcpy_to_msg(msg, skb->data, size);
754 if (err < 0) { 754 if (err < 0) {
755 skb_free_datagram(sk, skb); 755 skb_free_datagram(sk, skb);
756 return err; 756 return err;
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index e2e2e3cb9113..810228646de3 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1760,7 +1760,7 @@ static int dn_recvmsg(struct kiocb *iocb, struct socket *sock,
1760 if ((chunk + copied) > size) 1760 if ((chunk + copied) > size)
1761 chunk = size - copied; 1761 chunk = size - copied;
1762 1762
1763 if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { 1763 if (memcpy_to_msg(msg, skb->data, chunk)) {
1764 rv = -EFAULT; 1764 rv = -EFAULT;
1765 break; 1765 break;
1766 } 1766 }
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c239f4740d10..435443bfc3c3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1349,7 +1349,7 @@ static int tcp_recv_urg(struct sock *sk, struct msghdr *msg, int len, int flags)
1349 1349
1350 if (len > 0) { 1350 if (len > 0) {
1351 if (!(flags & MSG_TRUNC)) 1351 if (!(flags & MSG_TRUNC))
1352 err = memcpy_toiovec(msg->msg_iov, &c, 1); 1352 err = memcpy_to_msg(msg, &c, 1);
1353 len = 1; 1353 len = 1;
1354 } else 1354 } else
1355 msg->msg_flags |= MSG_TRUNC; 1355 msg->msg_flags |= MSG_TRUNC;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 9052462cf42a..568edc72d737 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1466,7 +1466,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock,
1466 } 1466 }
1467 1467
1468 chunk = min_t(unsigned int, skb->len, size); 1468 chunk = min_t(unsigned int, skb->len, size);
1469 if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { 1469 if (memcpy_to_msg(msg, skb->data, chunk)) {
1470 skb_queue_head(&sk->sk_receive_queue, skb); 1470 skb_queue_head(&sk->sk_receive_queue, skb);
1471 if (copied == 0) 1471 if (copied == 0)
1472 copied = -EFAULT; 1472 copied = -EFAULT;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 07ac95014ecb..108d7f381b87 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2949,8 +2949,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
2949 vnet_hdr.flags = VIRTIO_NET_HDR_F_DATA_VALID; 2949 vnet_hdr.flags = VIRTIO_NET_HDR_F_DATA_VALID;
2950 } /* else everything is zero */ 2950 } /* else everything is zero */
2951 2951
2952 err = memcpy_toiovec(msg->msg_iov, (void *)&vnet_hdr, 2952 err = memcpy_to_msg(msg, (void *)&vnet_hdr, vnet_hdr_len);
2953 vnet_hdr_len);
2954 if (err < 0) 2953 if (err < 0)
2955 goto out_free; 2954 goto out_free;
2956 } 2955 }