s390/cio: return -EFAULT if copy_to_user() fails again
authorWang Qing <wangqing@vivo.com>
Mon, 1 Mar 2021 12:01:33 +0000 (20:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:17 +0000 (17:06 +0100)
commit686874ca92c2863c713953e2f8c920a9ba9e012b
tree1e14c8dac7795a95a41f45b481eaf043647fa563
parentfd61e772f036601f267aadaecee789bd251baec2
s390/cio: return -EFAULT if copy_to_user() fails again

commit 51c44babdc19aaf882e1213325a0ba291573308f upstream.

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: e01bcdd61320 ("vfio: ccw: realize VFIO_DEVICE_GET_REGION_INFO ioctl")
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/1614600093-13992-1-git-send-email-wangqing@vivo.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/cio/vfio_ccw_ops.c