diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 1f06e76901067ffa1c08d586d0128f64ad6d6c65..712d02029971ed456a4025d23f0cd4d187d2f6ff 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, *s++ = '\n'; *s = '\0'; + /* Do nothing if *ppos is at the eof or beyond the eof. */ + if (s - page <= *ppos) + return 0; + start = page + *ppos; n = s - start; retval = n - copy_to_user(buf, start, min(n, nbytes));