projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b165d60
)
net/9p: Return error on read with NULL buffer
author
Sanchit Garg
<sancgarg@linux.vnet.ibm.com>
Wed, 27 Oct 2010 04:11:01 +0000
(09:41 +0530)
committer
Eric Van Hensbergen
<ericvh@gmail.com>
Thu, 28 Oct 2010 14:08:49 +0000
(09:08 -0500)
This patch ensures that a read(fd, NULL, 10) returns EFAULT on a 9p file.
Signed-off-by: Sanchit Garg <sancgarg@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
net/9p/client.c
patch
|
blob
|
history
diff --git
a/net/9p/client.c
b/net/9p/client.c
index
8df80fb
..
a848bca
100644
(file)
--- a/
net/9p/client.c
+++ b/
net/9p/client.c
@@
-1286,16
+1286,13
@@
p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
if (data) {
memmove(data, dataptr, count);
- }
-
- if (udata) {
+ } else {
err = copy_to_user(udata, dataptr, count);
if (err) {
err = -EFAULT;
goto free_and_error;
}
}
-
p9_free_req(clnt, req);
return count;