]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/fsl-mc: return -EFAULT if copy_to_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Oct 2020 11:34:50 +0000 (14:34 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 2 Nov 2020 22:00:06 +0000 (15:00 -0700)
commit6e8a893351f5a70f3d304c9c74304495c82967e8
tree48550a0d839441495ef35d09a395f2dc009f8946
parent73811218110e5585f36ecc0236dd14987477f18a
vfio/fsl-mc: return -EFAULT if copy_to_user() fails

The copy_to_user() function returns the number of bytes remaining to be
copied, but this code should return -EFAULT.

Fixes: 743e225e34c6 ("vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Diana Craciun <diana.craciun@oss.nxp.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/fsl-mc/vfio_fsl_mc.c