diff options
Diffstat (limited to 'drivers/cxl')
-rw-r--r-- | drivers/cxl/mem.c | 5 |
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, |