aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorRémi Denis-Courmont <rdenis@simphalempin.com>2008-02-15 05:35:45 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-15 05:35:45 -0500
commit997b37da1515c1620692521786a74af271664eb7 (patch)
treeffd071fe5efb432228f5c915d1fd3c91e2439088 /net/socket.c
parent69c3683ca7fe066ecba9e8a0424c5abd258a5d58 (diff)
[NET]: Make sure sockets implement splice_read
Fixes a segmentation fault when trying to splice from a non-TCP socket. Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index 7651de008502..b6d35cd72a50 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -701,6 +701,9 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
701{ 701{
702 struct socket *sock = file->private_data; 702 struct socket *sock = file->private_data;
703 703
704 if (unlikely(!sock->ops->splice_read))
705 return -EINVAL;
706
704 return sock->ops->splice_read(sock, ppos, pipe, len, flags); 707 return sock->ops->splice_read(sock, ppos, pipe, len, flags);
705} 708}
706 709