mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
69c3683ca7
commit
997b37da15
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue