RDMA/mlx5: Signedness bug in UVERBS_HANDLER()

The "num_actions" variable needs to be signed for the error handling to
work.  The maximum number of actions is less than 256 so int type is large
enough for that.

Fixes: cbfdd442c4 ("IB/uverbs: Add helper to get array size from ptr attribute")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-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:43:32 +03:00 committed by Jason Gunthorpe
parent 573671a5f6
commit 58f7c0bfb4

View File

@ -329,7 +329,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_ACTION_CREATE_MODIFY_HEADER)(
struct mlx5_ib_dev *mdev = to_mdev(uobj->context->device);
enum mlx5_ib_uapi_flow_table_type ft_type;
struct ib_flow_action *action;
size_t num_actions;
int num_actions;
void *in;
int ret;