aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-12-22 10:42:59 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-12-22 16:07:13 -0700
commit573671a5f6509c4139770452d4516720a84d5b61 (patch)
tree3ea7b6a5b71b329a8d6cdcaff1b4ab1c88a85b01 /drivers/infiniband/core
parentIB/mlx5: Allocate the per-port Q counter shared when DEVX is supported (diff)
downloadlinux-dev-573671a5f6509c4139770452d4516720a84d5b61.tar.xz
linux-dev-573671a5f6509c4139770452d4516720a84d5b61.zip
IB/uverbs: Signedness bug in UVERBS_HANDLER()
The "num_sge" variable needs to be signed for the error handling to work. The uverbs_attr_ptr_get_array_size() returns int so this change is safe. Fixes: ad8a4496757f ("IB/uverbs: Add support to advise_mr") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_std_types_mr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_mr.c b/drivers/infiniband/core/uverbs_std_types_mr.c
index 71dfa5e5938e..4d4be0c2b752 100644
--- a/drivers/infiniband/core/uverbs_std_types_mr.c
+++ b/drivers/infiniband/core/uverbs_std_types_mr.c
@@ -47,7 +47,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_ADVISE_MR)(
enum ib_uverbs_advise_mr_advice advice;
struct ib_device *ib_dev = pd->device;
struct ib_sge *sg_list;
- u32 num_sge;
+ int num_sge;
u32 flags;
int ret;