diff options
-rw-r--r-- | kernel/cpuset.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 1f06e7690106..712d02029971 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -972,6 +972,10 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf, | |||
972 | *s++ = '\n'; | 972 | *s++ = '\n'; |
973 | *s = '\0'; | 973 | *s = '\0'; |
974 | 974 | ||
975 | /* Do nothing if *ppos is at the eof or beyond the eof. */ | ||
976 | if (s - page <= *ppos) | ||
977 | return 0; | ||
978 | |||
975 | start = page + *ppos; | 979 | start = page + *ppos; |
976 | n = s - start; | 980 | n = s - start; |
977 | retval = n - copy_to_user(buf, start, min(n, nbytes)); | 981 | retval = n - copy_to_user(buf, start, min(n, nbytes)); |