aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-03-27 16:50:46 -0700
committerJason Gunthorpe <jgg@mellanox.com>2019-03-28 10:22:48 -0300
commit2dcdebff5e84356824c800ae5217c02ef0f78b06 (patch)
tree5c67e4475e63acc316e7b2c7ff9aaa1b0fc86780
parentRDMA/uverbs: Add a __user annotation to a pointer (diff)
downloadlinux-dev-2dcdebff5e84356824c800ae5217c02ef0f78b06.tar.xz
linux-dev-2dcdebff5e84356824c800ae5217c02ef0f78b06.zip
RDMA/uverbs: Annotate uverbs_request_next_ptr() return value as a __user pointer
This patch avoids that sparse complains about a mismatch between the returned value and the function return type. Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Fixes: c3bea3d2dc53 ("RDMA/uverbs: Use the iterator for ib_uverbs_unmarshall_recv()") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 062a86c04123..c9acd94b049d 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -162,7 +162,7 @@ static const void __user *uverbs_request_next_ptr(struct uverbs_req_iter *iter,
const void __user *res = iter->cur;
if (iter->cur + len > iter->end)
- return ERR_PTR(-ENOSPC);
+ return (void __force __user *)ERR_PTR(-ENOSPC);
iter->cur += len;
return res;
}