skip copy_to_user() when r->ret is negative error number in mckernel_procfs_read().
refs #370
This commit is contained in:
@ -380,6 +380,7 @@ retry:
|
|||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (r->ret > 0) {
|
||||||
if (copy_to_user(buf, kern_buffer, r->ret)) {
|
if (copy_to_user(buf, kern_buffer, r->ret)) {
|
||||||
kprintf("ERROR: mckernel_procfs_read: copy_to_user failed.\n");
|
kprintf("ERROR: mckernel_procfs_read: copy_to_user failed.\n");
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
@ -387,6 +388,7 @@ retry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
*ppos += r->ret;
|
*ppos += r->ret;
|
||||||
|
}
|
||||||
ret = r->ret;
|
ret = r->ret;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|||||||
Reference in New Issue
Block a user