Skip to content

Commit

Permalink
s390/cio: return -EFAULT if copy_to_user() fails
Browse files Browse the repository at this point in the history
Fixes: 120e214 ("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>
  • Loading branch information
efarman authored and hcahca committed Mar 8, 2021
1 parent db232eb commit d9c48a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/cio/vfio_ccw_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
{
Expand Down

0 comments on commit d9c48a9

Please sign in to comment.