aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cpqarray.c
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-08-03 06:52:55 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:53:03 -0400
commitf6c4c8e19a087dae7dc651ccbd1ff8b843eedee2 (patch)
tree49ef8d3044def969cd6bac6a3ef9e09d19a18803 /drivers/block/cpqarray.c
parent08852b6d6c40f387f2b75e199e2ca1df68970f4c (diff)
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/cpqarray.c')
-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:
1179 return error; 1179 return error;
1180 case IDAGETCTLRSIG: 1180 case IDAGETCTLRSIG:
1181 if (!arg) return -EINVAL; 1181 if (!arg) return -EINVAL;
1182 put_user(host->ctlr_sig, (int __user *)arg); 1182 if (put_user(host->ctlr_sig, (int __user *)arg))
1183 return -EFAULT;
1183 return 0; 1184 return 0;
1184 case IDAREVALIDATEVOLS: 1185 case IDAREVALIDATEVOLS:
1185 if (MINOR(bdev->bd_dev) != 0) 1186 if (MINOR(bdev->bd_dev) != 0)
@@ -1187,7 +1188,8 @@ out_passthru:
1187 return revalidate_allvol(host); 1188 return revalidate_allvol(host);
1188 case IDADRIVERVERSION: 1189 case IDADRIVERVERSION:
1189 if (!arg) return -EINVAL; 1190 if (!arg) return -EINVAL;
1190 put_user(DRIVER_VERSION, (unsigned long __user *)arg); 1191 if (put_user(DRIVER_VERSION, (unsigned long __user *)arg))
1192 return -EFAULT;
1191 return 0; 1193 return 0;
1192 case IDAGETPCIINFO: 1194 case IDAGETPCIINFO:
1193 { 1195 {