remoteproc: return -EFAULT on copy_from_user failure
Subsystems (2)
PATCH 3/3 remoteproc: return -EFAULT on copy_from_user failure
copy_from_user() returns the number of bytes remaining to be copied, but we want to return an error code here.
Signed-off-by Dan Carpenter <[email protected]>
drivers/remoteproc/remoteproc_debugfs.c +1 -1
@@ -161,7 +161,7 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf, ret =copy_from_user (buf, user_buf, count);if (ret) -return ret; +return -EFAULT ;/* remove end of line */ if (buf[count -1 ] ='\n' )
Ohad Ben-Cohen
AppliedQuoted 4 lines · Dan Carpenter
copy_from_user()returns the number of bytes remaining to be copied, but we want to return an error code here.Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks.