cxl/mem: Return -EFAULT if copy_to_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 Feb 2021 09:54:38 +0000 (12:54 +0300)
committerDan Williams <dan.j.williams@intel.com>
Fri, 19 Feb 2021 15:40:23 +0000 (07:40 -0800)
commit58294927f468a428c7a1ba09cf986fdca14a2747
tree33254d7e5091702c416c619cfd2acb32f87e3685
parent68a5a9a243354ed52f7b37b057bd5e98cba870c8
cxl/mem: Return -EFAULT if copy_to_user() fails

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.

Fixes: b754ffbbc0ee ("cxl/mem: Add basic IOCTL interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YC+K3kgzqm20zCWY@mwanda
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/mem.c