summaryrefslogtreecommitdiff
path: root/drivers/cxl/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cxl/mem.c')
-rw-r--r--drivers/cxl/mem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c
index 6d7d3870b5da..df895bcca63a 100644
--- a/drivers/cxl/mem.c
+++ b/drivers/cxl/mem.c
@@ -752,7 +752,10 @@ static int cxl_send_cmd(struct cxl_memdev *cxlmd,
if (rc)
return rc;
- return copy_to_user(s, &send, sizeof(send));
+ if (copy_to_user(s, &send, sizeof(send)))
+ return -EFAULT;
+
+ return 0;
}
static long __cxl_memdev_ioctl(struct cxl_memdev *cxlmd, unsigned int cmd,