RDMA/uverbs: Add a __user annotation to a pointer
authorBart Van Assche <bvanassche@acm.org>
Wed, 27 Mar 2019 23:50:45 +0000 (16:50 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 28 Mar 2019 13:22:48 +0000 (10:22 -0300)
This patch avoids that sparse and smatch report the following:

  warning: cast removes address space of expression

Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Fixes: 3a6532c9af1a ("RDMA/uverbs: Use uverbs_attr_bundle to pass udata for write")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_main.c

index 70b7d80431a9b935b9a7ffa6fa50be6601f9c4a0..b8fc5a329e212d9decc3c4faac22d8dc6b3e77ec 100644 (file)
@@ -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;