summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-08-03 14:52:55 +0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 20:53:03 +0400
commitf6c4c8e19a087dae7dc651ccbd1ff8b843eedee2 (patch)
tree49ef8d3044def969cd6bac6a3ef9e09d19a18803 /drivers/block
parent08852b6d6c40f387f2b75e199e2ca1df68970f4c (diff)
downloadlinux-f6c4c8e19a087dae7dc651ccbd1ff8b843eedee2.tar.xz
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 9473215956f9..d53b0291c44b 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:
{