diff mbox series

[1/8] RDMA/uverbs: Add a __user annotation to a pointer

Message ID 20190321172417.77869-2-bvanassche@acm.org (mailing list archive)
State Superseded
Headers show
Series Multiple fixes for issues reported by static checkers | expand

Commit Message

Bart Van Assche March 21, 2019, 5:24 p.m. UTC
This patch avoids that sparse and smatch report the following:

  warning: cast removes address space of expression

Fixes: 3a6532c9af1a ("RDMA/uverbs: Use uverbs_attr_bundle to pass udata for write") # v5.0.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/core/uverbs_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leon Romanovsky March 26, 2019, 10:19 a.m. UTC | #1
On Thu, Mar 21, 2019 at 10:24:10AM -0700, Bart Van Assche wrote:
> This patch avoids that sparse and smatch report the following:
>
>   warning: cast removes address space of expression
>
> Fixes: 3a6532c9af1a ("RDMA/uverbs: Use uverbs_attr_bundle to pass udata for write") # v5.0.
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/infiniband/core/uverbs_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
diff mbox series

Patch

diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 70b7d80431a9..b8fc5a329e21 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -720,7 +720,7 @@  static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
 			 * then the command request structure starts
 			 * with a '__aligned u64 response' member.
 			 */
-			ret = get_user(response, (const u64 *)buf);
+			ret = get_user(response, (const u64 __user *)buf);
 			if (ret)
 				goto out_unlock;