From: Rémi Denis-Courmont Date: Fri, 15 Feb 2008 10:35:45 +0000 (-0800) Subject: [NET]: Make sure sockets implement splice_read X-Git-Tag: v2.6.25-rc2~2^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=997b37da1515c1620692521786a74af271664eb7;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: David S. Miller --- diff --git a/net/socket.c b/net/socket.c index 7651de00850..b6d35cd72a5 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); }