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
commit d9c48a9 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
efarman authored and gregkh committed Mar 17, 2021
1 parent bc8ceb4 commit 8c64644
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/cio/vfio_ccw_ops.c
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 8c64644

Please sign in to comment.