mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] fix for cpusets minor problem
This patch fixes minor problem that the CPUSETS have when files in the cpuset filesystem are read after lseek()-ed beyond the EOF. Signed-off-by: KUROSAWA Takahiro <[email protected]> Acked-by: Paul Jackson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
ac0b1bc1ed
commit
73a358d189
1 changed files with 4 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue