]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: Make sure sockets implement splice_read
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Fri, 15 Feb 2008 10:35:45 +0000 (02:35 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Feb 2008 10:35:45 +0000 (02:35 -0800)
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>
net/socket.c

index 7651de0085028dc4d02b15e5844e239dd938d01e..b6d35cd72a50988e2075683ff757902ec7af6ccc 100644 (file)
@@ -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);
 }