public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/mlx5: Signedness bug in UVERBS_HANDLER()
@ 2018-12-22  7:43 Dan Carpenter
  2018-12-22  8:37 ` Leon Romanovsky
  2018-12-22 23:09 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-12-22  7:43 UTC (permalink / raw)
  To: kernel-janitors

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>
---
 drivers/infiniband/hw/mlx5/flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-22 23:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-22  7:43 [PATCH] RDMA/mlx5: Signedness bug in UVERBS_HANDLER() Dan Carpenter
2018-12-22  8:37 ` Leon Romanovsky
2018-12-22 23:09 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox