aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-12-22 10:43:32 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-12-22 16:07:13 -0700
commit58f7c0bfb4e111006ba376df7ab266a6d42d64ba (patch)
treebd333e4e0e60ceef79460e705a3c482914876904 /drivers/infiniband/hw
parentIB/uverbs: Signedness bug in UVERBS_HANDLER() (diff)
downloadlinux-dev-58f7c0bfb4e111006ba376df7ab266a6d42d64ba.tar.xz
linux-dev-58f7c0bfb4e111006ba376df7ab266a6d42d64ba.zip
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: cbfdd442c43e ("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>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/mlx5/flow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/flow.c b/drivers/infiniband/hw/mlx5/flow.c
index 95cf4b9fc65d..e8a1e4498e3f 100644
--- a/drivers/infiniband/hw/mlx5/flow.c
+++ b/drivers/infiniband/hw/mlx5/flow.c
@@ -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;