diff options
author | Rémi Denis-Courmont <rdenis@simphalempin.com> | 2008-02-15 02:35:45 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-15 02:35:45 -0800 |
commit | 997b37da1515c1620692521786a74af271664eb7 (patch) | |
tree | ffd071fe5efb432228f5c915d1fd3c91e2439088 /net/socket.c | |
parent | 69c3683ca7fe066ecba9e8a0424c5abd258a5d58 (diff) | |
download | lwn-997b37da1515c1620692521786a74af271664eb7.tar.gz lwn-997b37da1515c1620692521786a74af271664eb7.zip |
[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.c | 3 |
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, { struct socket *sock = file->private_data; + if (unlikely(!sock->ops->splice_read)) + return -EINVAL; + return sock->ops->splice_read(sock, ppos, pipe, len, flags); } |