提交 f6c4c8e1 编写于 作者: K Kulikov Vasiliy 提交者: Jens Axboe

cpqarray: check put_user() result

put_user() may fail, if so return -EFAULT.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Acked-by: NMike Miller <mike.miller@hp.com>
Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
上级 08852b6d
......@@ -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:
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册