diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/raw.c | 1 | ||||
-rw-r--r-- | net/socket.c | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 6d0fa8fb8af0..f2fc92a1241a 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/stddef.h> | 46 | #include <linux/stddef.h> |
47 | #include <linux/slab.h> | 47 | #include <linux/slab.h> |
48 | #include <linux/errno.h> | 48 | #include <linux/errno.h> |
49 | #include <linux/aio.h> | ||
50 | #include <linux/kernel.h> | 49 | #include <linux/kernel.h> |
51 | #include <linux/export.h> | 50 | #include <linux/export.h> |
52 | #include <linux/spinlock.h> | 51 | #include <linux/spinlock.h> |
diff --git a/net/socket.c b/net/socket.c index 073809f4125f..989b1ae32afa 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -808,10 +808,10 @@ static ssize_t sock_read_iter(struct kiocb *iocb, struct iov_iter *to) | |||
808 | if (iocb->ki_pos != 0) | 808 | if (iocb->ki_pos != 0) |
809 | return -ESPIPE; | 809 | return -ESPIPE; |
810 | 810 | ||
811 | if (iocb->ki_nbytes == 0) /* Match SYS5 behaviour */ | 811 | if (!iov_iter_count(to)) /* Match SYS5 behaviour */ |
812 | return 0; | 812 | return 0; |
813 | 813 | ||
814 | res = sock_recvmsg(sock, &msg, iocb->ki_nbytes, msg.msg_flags); | 814 | res = sock_recvmsg(sock, &msg, iov_iter_count(to), msg.msg_flags); |
815 | *to = msg.msg_iter; | 815 | *to = msg.msg_iter; |
816 | return res; | 816 | return res; |
817 | } | 817 | } |
@@ -833,7 +833,7 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from) | |||
833 | if (sock->type == SOCK_SEQPACKET) | 833 | if (sock->type == SOCK_SEQPACKET) |
834 | msg.msg_flags |= MSG_EOR; | 834 | msg.msg_flags |= MSG_EOR; |
835 | 835 | ||
836 | res = sock_sendmsg(sock, &msg, iocb->ki_nbytes); | 836 | res = sock_sendmsg(sock, &msg, iov_iter_count(from)); |
837 | *from = msg.msg_iter; | 837 | *from = msg.msg_iter; |
838 | return res; | 838 | return res; |
839 | } | 839 | } |