summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/xilinx_sdfec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c
index dc1b8b412712..813b82c59360 100644
--- a/drivers/misc/xilinx_sdfec.c
+++ b/drivers/misc/xilinx_sdfec.c
@@ -651,9 +651,10 @@ static int xsdfec_add_ldpc(struct xsdfec_dev *xsdfec, void __user *arg)
if (!ldpc)
return -ENOMEM;
- ret = copy_from_user(ldpc, arg, sizeof(*ldpc));
- if (ret)
+ if (copy_from_user(ldpc, arg, sizeof(*ldpc))) {
+ ret = -EFAULT;
goto err_out;
+ }
if (xsdfec->config.code == XSDFEC_TURBO_CODE) {
ret = -EIO;