diff options
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 79866bc6b3a1..45a5719a0104 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -968,8 +968,6 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf, | |||
968 | char *page; | 968 | char *page; |
969 | ssize_t retval = 0; | 969 | ssize_t retval = 0; |
970 | char *s; | 970 | char *s; |
971 | char *start; | ||
972 | size_t n; | ||
973 | 971 | ||
974 | if (!(page = (char *)__get_free_page(GFP_KERNEL))) | 972 | if (!(page = (char *)__get_free_page(GFP_KERNEL))) |
975 | return -ENOMEM; | 973 | return -ENOMEM; |
@@ -999,14 +997,7 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf, | |||
999 | *s++ = '\n'; | 997 | *s++ = '\n'; |
1000 | *s = '\0'; | 998 | *s = '\0'; |
1001 | 999 | ||
1002 | /* Do nothing if *ppos is at the eof or beyond the eof. */ | 1000 | retval = simple_read_from_buffer(buf, nbytes, ppos, page, s - page); |
1003 | if (s - page <= *ppos) | ||
1004 | return 0; | ||
1005 | |||
1006 | start = page + *ppos; | ||
1007 | n = s - start; | ||
1008 | retval = n - copy_to_user(buf, start, min(n, nbytes)); | ||
1009 | *ppos += retval; | ||
1010 | out: | 1001 | out: |
1011 | free_page((unsigned long)page); | 1002 | free_page((unsigned long)page); |
1012 | return retval; | 1003 | return retval; |