summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-08-03 12:52:55 +0200
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 18:53:03 +0200
commitf6c4c8e19a087dae7dc651ccbd1ff8b843eedee2 (patch)
tree49ef8d3044def969cd6bac6a3ef9e09d19a18803 /drivers/block
parent08852b6d6c40f387f2b75e199e2ca1df68970f4c (diff)
downloadop-kernel-dev-f6c4c8e19a087dae7dc651ccbd1ff8b843eedee2.zip
op-kernel-dev-f6c4c8e19a087dae7dc651ccbd1ff8b843eedee2.tar.gz
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>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cpqarray.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 9473215..d53b029 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -1179,7 +1179,8 @@ out_passthru:
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 @@ out_passthru:
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:
{
OpenPOWER on IntegriCloud