misc: xilinx_sdfec: Return -EFAULT if copy_from_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 22 Aug 2019 08:31:05 +0000 (11:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Aug 2019 21:28:10 +0000 (14:28 -0700)
commit129c3b082c636087a72a30b17c87c57d197f08f5
tree11a33c03ae31494f70b841b56ec4a6d6deaa4562
parentdac4f1964a9cbfbf81df8d31caa04ced0d7613b5
misc: xilinx_sdfec: Return -EFAULT if copy_from_user() fails

The copy_from_user() function returns the number of bytes remaining to
be copied but we want to return -EFAULT to the user.

Fixes: 20ec628e8007 ("misc: xilinx_sdfec: Add ability to configure LDPC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Dragan Cvetic <dragan.cvetic@xilinx.com>
Link: https://lore.kernel.org/r/20190822083105.GI3964@kadam
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/xilinx_sdfec.c