Commit f6c4c8e1 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Jens Axboe

cpqarray: check put_user() result

put_user() may fail, if so return -EFAULT.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Acked-by: default avatarMike Miller <mike.miller@hp.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 08852b6d
...@@ -1179,7 +1179,8 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in ...@@ -1179,7 +1179,8 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in
return error; return error;
case IDAGETCTLRSIG: case IDAGETCTLRSIG:
if (!arg) return -EINVAL; if (!arg) return -EINVAL;
put_user(host->ctlr_sig, (int __user *)arg); if (put_user(host->ctlr_sig, (int __user *)arg))
return -EFAULT;
return 0; return 0;
case IDAREVALIDATEVOLS: case IDAREVALIDATEVOLS:
if (MINOR(bdev->bd_dev) != 0) if (MINOR(bdev->bd_dev) != 0)
...@@ -1187,7 +1188,8 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in ...@@ -1187,7 +1188,8 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in
return revalidate_allvol(host); return revalidate_allvol(host);
case IDADRIVERVERSION: case IDADRIVERVERSION:
if (!arg) return -EINVAL; if (!arg) return -EINVAL;
put_user(DRIVER_VERSION, (unsigned long __user *)arg); if (put_user(DRIVER_VERSION, (unsigned long __user *)arg))
return -EFAULT;
return 0; return 0;
case IDAGETPCIINFO: case IDAGETPCIINFO:
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment