diff options
author | Nikanth Karthikesan <knikanth@suse.de> | 2009-09-23 18:57:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 10:21:03 -0400 |
commit | bb521c5de070b86a1e049e2dbf62328f717ff1e8 (patch) | |
tree | e2a4416f35e84873f75c0e86ebae5552cf4ae2b2 /drivers/char/mem.c | |
parent | 0b8c78f2bfa6ebed0f47794b5995a0d4b3fe456d (diff) |
/dev/zero: avoid repeated access_ok() checks
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: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r-- | drivers/char/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 0aede1d6a9ea..6c8b65d069e5 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -690,7 +690,7 @@ static ssize_t read_zero(struct file * file, char __user * buf, | |||
690 | 690 | ||
691 | if (chunk > PAGE_SIZE) | 691 | if (chunk > PAGE_SIZE) |
692 | chunk = PAGE_SIZE; /* Just for latency reasons */ | 692 | chunk = PAGE_SIZE; /* Just for latency reasons */ |
693 | unwritten = clear_user(buf, chunk); | 693 | unwritten = __clear_user(buf, chunk); |
694 | written += chunk - unwritten; | 694 | written += chunk - unwritten; |
695 | if (unwritten) | 695 | if (unwritten) |
696 | break; | 696 | break; |