From bec109a430e8c67bae1743f7e71898283234a77f Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 25 Sep 2012 10:05:33 +0300 Subject: [PATCH] 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 Signed-off-by: Ohad Ben-Cohen --- drivers/remoteproc/remoteproc_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index ea90a5643db3..157a57309601 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -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')