vfio/pci: return -EFAULT if copy_to_user fails
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 25 Feb 2016 07:52:12 +0000 (10:52 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 26 Feb 2016 04:48:42 +0000 (21:48 -0700)
commitc4aec3101319f84363a57e09086c2aff6c60a3c3
tree553031dcd815fc2059ecb467d611c23df4d565ef
parenta13b64591747e8a4ab2df24540a17fca34de2d34
vfio/pci: return -EFAULT if copy_to_user fails

The copy_to_user() function returns the number of bytes that were not
copied but we want to return -EFAULT on error here.

Fixes: 188ad9d6cbbc ('vfio/pci: Include sparse mmap capability for MSI-X table regions')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci.c