提交 f6ac55b6 编写于 作者: S Sanchit Garg 提交者: Eric Van Hensbergen

net/9p: Return error on read with NULL buffer

This patch ensures that a read(fd, NULL, 10) returns  EFAULT on a 9p file.
Signed-off-by: NSanchit Garg <sancgarg@linux.vnet.ibm.com>
Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 b165d601
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册