Skip to content

Commit

Permalink
cpqarray: check put_user() result
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kulikov Vasiliy authored and Jens Axboe committed Aug 7, 2010
1 parent 08852b6 commit f6c4c8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/block/cpqarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,15 +1179,17 @@ 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)
return -ENXIO;
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:
{
Expand Down

0 comments on commit f6c4c8e

Please sign in to comment.