arc: kernel: Return -EFAULT if copy_to_user() fails

[ Upstream commit 46e152186c ]

The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return -EFAULT if the copy doesn't complete.

Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Wang Qing 2021-03-01 20:05:48 +08:00 • committed by Greg Kroah-Hartman
commit b448a6a2fc