staging/lustre/lloop: Properly mark userspace pointers in lo/lloop_ioctl
authorOleg Drokin <green@linuxhacker.ru>
Sun, 3 Jan 2016 17:05:52 +0000 (12:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2016 22:34:00 +0000 (14:34 -0800)
When casting unsigned long userspace pointer for use with
userspace-accessing functions, need to use __user attribute to make
sparse happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/lloop.c

index 871924b3f2e72f44a8360cb1e6638d1c13b0eee3..69c41afd1faaa3b8c6089ff1ce4afd9fd080da10 100644 (file)
@@ -636,7 +636,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
                else
                        fid_zero(&fid);
 
-               if (copy_to_user((struct lu_fid *)arg, &fid, sizeof(fid)))
+               if (copy_to_user((void __user *)arg, &fid, sizeof(fid)))
                        err = -EFAULT;
                break;
        }
@@ -708,7 +708,7 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file,
                dev = MKDEV(lloop_major, lo->lo_number);
 
                /* quit if the used pointer is writable */
-               if (put_user((long)old_encode_dev(dev), (long *)arg)) {
+               if (put_user((long)old_encode_dev(dev), (long __user *)arg)) {
                        err = -EFAULT;
                        goto out;
                }