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-Url: https://git.stricted.de/?a=commitdiff_plain;h=997b37da1515c1620692521786a74af271664eb7;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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); }