]> git.baikalelectronics.ru Git - kernel.git/commit
s390/cio: return -EFAULT if copy_to_user() fails
authorWang Qing <wangqing@vivo.com>
Mon, 1 Mar 2021 12:01:33 +0000 (20:01 +0800)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 8 Mar 2021 09:46:29 +0000 (10:46 +0100)
commitfb14a9b3b6985ef94ffa563687986e9eee70e635
treee672a65cdca9dc3cfa5bdb5ece9dbf63e58afa00
parent147142fbad00e32bf5298c156df1d77c35ebc17b
s390/cio: 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: 30b0f662f1b2 ("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>
drivers/s390/cio/vfio_ccw_ops.c