projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69c3683
)
[NET]: Make sure sockets implement splice_read
author
Rémi Denis-Courmont
<rdenis@simphalempin.com>
Fri, 15 Feb 2008 10:35:45 +0000
(
02:35
-0800)
committer
David S. Miller
<davem@davemloft.net>
Fri, 15 Feb 2008 10:35:45 +0000
(
02:35
-0800)
Fixes a segmentation fault when trying to splice from a non-TCP socket.
Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/net/socket.c
b/net/socket.c
index 7651de0085028dc4d02b15e5844e239dd938d01e..b6d35cd72a50988e2075683ff757902ec7af6ccc 100644
(file)
--- 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);
}