X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fcpuset.c;h=712d02029971ed456a4025d23f0cd4d187d2f6ff;hb=3874b98c655b9490bea1cf9c7697d5dc5338376f;hp=1f06e76901067ffa1c08d586d0128f64ad6d6c65;hpb=1077682b2f97cee76a79cf38bab3fa022a97d9f8;p=linux-2.6 diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 1f06e76901..712d020299 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));