summaryrefslogtreecommitdiff
path: root/drivers/s390
diff options
context:
space:
mode:
authorEric Farman <farman@linux.ibm.com>2021-03-01 19:33:24 +0100
committerHeiko Carstens <hca@linux.ibm.com>2021-03-08 10:46:30 +0100
commitd9c48a948d29bcb22f4fe61a81b718ef6de561a0 (patch)
treef04d4d6b8b7f81ec5dcc698b1da357725348cbb4 /drivers/s390
parentdb232eb42c21b7bca8e46c7e74676754b8fe06ea (diff)
s390/cio: return -EFAULT if copy_to_user() fails
Fixes: 120e214e504f ("vfio: ccw: realize VFIO_DEVICE_G(S)ET_IRQ_INFO ioctls") Signed-off-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/vfio_ccw_ops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/cio/vfio_ccw_ops.c b/drivers/s390/cio/vfio_ccw_ops.c
index 557d0b888cd3..767ac41686fe 100644
--- a/drivers/s390/cio/vfio_ccw_ops.c
+++ b/drivers/s390/cio/vfio_ccw_ops.c
@@ -582,7 +582,7 @@ static ssize_t vfio_ccw_mdev_ioctl(struct mdev_device *mdev,
if (info.count == -1)
return -EINVAL;
- return copy_to_user((void __user *)arg, &info, minsz);
+ return copy_to_user((void __user *)arg, &info, minsz) ? -EFAULT : 0;
}
case VFIO_DEVICE_SET_IRQS:
{