aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/socket.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/net/socket.c b/net/socket.c
index 0ceaa5cb9ead..ebed4b68f768 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -854,11 +854,6 @@ int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
854} 854}
855EXPORT_SYMBOL(kernel_recvmsg); 855EXPORT_SYMBOL(kernel_recvmsg);
856 856
857static void sock_aio_dtor(struct kiocb *iocb)
858{
859 kfree(iocb->private);
860}
861
862static ssize_t sock_sendpage(struct file *file, struct page *page, 857static ssize_t sock_sendpage(struct file *file, struct page *page,
863 int offset, size_t size, loff_t *ppos, int more) 858 int offset, size_t size, loff_t *ppos, int more)
864{ 859{
@@ -889,12 +884,8 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
889static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb, 884static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
890 struct sock_iocb *siocb) 885 struct sock_iocb *siocb)
891{ 886{
892 if (!is_sync_kiocb(iocb)) { 887 if (!is_sync_kiocb(iocb))
893 siocb = kmalloc(sizeof(*siocb), GFP_KERNEL); 888 BUG();
894 if (!siocb)
895 return NULL;
896 iocb->ki_dtor = sock_aio_dtor;
897 }
898 889
899 siocb->kiocb = iocb; 890 siocb->kiocb = iocb;
900 iocb->private = siocb; 891 iocb->private = siocb;
@@ -931,7 +922,7 @@ static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov,
931 if (pos != 0) 922 if (pos != 0)
932 return -ESPIPE; 923 return -ESPIPE;
933 924
934 if (iocb->ki_left == 0) /* Match SYS5 behaviour */ 925 if (iocb->ki_nbytes == 0) /* Match SYS5 behaviour */
935 return 0; 926 return 0;
936 927
937 928