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: ad8a449675 ("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>
This commit is contained in:
Dan Carpenter 2018-12-22 10:42:59 +03:00 committed by Jason Gunthorpe
parent aa74be6eea
commit 573671a5f6
1 changed files with 1 additions and 1 deletions

View File

@ -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;