Commit 74614db0 authored by Nikanth Karthikesan's avatar Nikanth Karthikesan Committed by James Toy

In read_zero, we check for access_ok() once for the count bytes. It is

unnecessarily checked again in clear_user.  Use __clear_user, which does
not check for access_ok().
Signed-off-by: default avatarNikanth Karthikesan <knikanth@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 684c3693
...@@ -647,7 +647,7 @@ static ssize_t read_zero(struct file * file, char __user * buf, ...@@ -647,7 +647,7 @@ static ssize_t read_zero(struct file * file, char __user * buf,
if (chunk > PAGE_SIZE) if (chunk > PAGE_SIZE)
chunk = PAGE_SIZE; /* Just for latency reasons */ chunk = PAGE_SIZE; /* Just for latency reasons */
unwritten = clear_user(buf, chunk); unwritten = __clear_user(buf, chunk);
written += chunk - unwritten; written += chunk - unwritten;
if (unwritten) if (unwritten)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment