Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 997b37da authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by David S. Miller
Browse files

[NET]: Make sure sockets implement splice_read



Fixes a segmentation fault when trying to splice from a non-TCP socket.

Signed-off-by: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 69c3683c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
}