[PATCH] ext4/ioctl.c: copy_{from,to}_user expect __user pointers

From: H Hartley Sweeten
Date: Fri Sep 23 2011 - 18:26:37 EST


This quiets the sparse noise:

warning: incorrect type in argument 2 (different address spaces)
expected void const [noderef] <asn:1>*from
got struct fstrim_range *<noident>
warning: incorrect type in argument 1 (different address spaces)
expected void [noderef] <asn:1>*to
got struct fstrim_range *<noident>

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: "Theodore Ts'o" <tytso@xxxxxxx>
Cc: Andreas Dilger <adilger.kernel@xxxxxxxxx>

---

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index f18bfe3..43759b1 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -348,7 +348,7 @@ mext_out:
if (!blk_queue_discard(q))
return -EOPNOTSUPP;

- if (copy_from_user(&range, (struct fstrim_range *)arg,
+ if (copy_from_user(&range, (struct fstrim_range __user *)arg,
sizeof(range)))
return -EFAULT;

@@ -358,7 +358,7 @@ mext_out:
if (ret < 0)
return ret;

- if (copy_to_user((struct fstrim_range *)arg, &range,
+ if (copy_to_user((struct fstrim_range __user *)arg, &range,
sizeof(range)))
return -EFAULT;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/