提交 997b37da 编写于 作者: R Rémi Denis-Courmont 提交者: David S. Miller

[NET]: Make sure sockets implement splice_read

Fixes a segmentation fault when trying to splice from a non-TCP socket.
Signed-off-by: NRémi Denis-Courmont <rdenis@simphalempin.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 69c3683c
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册