forked from luck/tmp_suning_uos_patched
cpqarray: check put_user() result
put_user() may fail, if so return -EFAULT. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
parent
08852b6d6c
commit
f6c4c8e19a
|
@ -1179,7 +1179,8 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in
|
|||
return error;
|
||||
case IDAGETCTLRSIG:
|
||||
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;
|
||||
case IDAREVALIDATEVOLS:
|
||||
if (MINOR(bdev->bd_dev) != 0)
|
||||
|
@ -1187,7 +1188,8 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in
|
|||
return revalidate_allvol(host);
|
||||
case IDADRIVERVERSION:
|
||||
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;
|
||||
case IDAGETPCIINFO:
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user