IB/mlx5: Fix an error code in __mlx5_ib_modify_qp()
Subsystems (3)
PATCH 1/1 IB/mlx5: Fix an error code in __mlx5_ib_modify_qp()
"err" is either zero or possibly uninitialized here. It should be -EINVAL.
Fixes 427c1e7bcd7e ("{IB, net}/mlx5: Move the modify QP operation table to mlx5_ib")
Signed-off-by Dan Carpenter <[email protected]>
drivers/infiniband/hw/mlx5/qp.c +3 -1
@@ -3118,8 +3118,10 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, mlx5_new =to_mlx5_state (new_state);if (mlx5_cur >=MLX5_QP_NUM_STATE || mlx5_new >=MLX5_QP_NUM_STATE || - !optab[mlx5_cur][mlx5_new]) + !optab[mlx5_cur][mlx5_new]) { + err = -EINVAL ; goto out; + } op = optab[mlx5_cur][mlx5_new]; optpar =ib_mask_to_mlx5_opt (attr_mask);
Quoted 11 lines · Dan Carpenter
"err" is either zero or possibly uninitialized here. It should be
-EINVAL.Fixes 427c1e7bcd7e ("{IB, net}/mlx5: Move the modify QP operation table to mlx5_ib")Signed-off-by Dan Carpenter <[email protected]>drivers/infiniband/hw/mlx5/qp.c +0
-0
drivers/infiniband/hw/mlx5/qp.c static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, · line 3125
Quoted 9 lines
drivers/infiniband/hw/mlx5/qp.c +3
-1@@ -3118,8 +3118,10 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, mlx5_new =to_mlx5_state (new_state);if (mlx5_cur >=MLX5_QP_NUM_STATE || mlx5_new >=MLX5_QP_NUM_STATE || - !optab[mlx5_cur][mlx5_new]) + !optab[mlx5_cur][mlx5_new]) { + err = -EINVAL ; goto out; + }
Thanks Dan,
Acked-by Leon Romanovsky <[email protected]>
Jason Gunthorpe
AppliedQuoted 12 lines · Dan Carpenter
"err" is either zero or possibly uninitialized here. It should be
-EINVAL.Fixes 427c1e7bcd7e ("{IB, net}/mlx5: Move the modify QP operation table to mlx5_ib")Signed-off-by Dan Carpenter <[email protected]>Acked-by Leon Romanovsky <[email protected]>drivers/infiniband/hw/mlx5/qp.c +1
-0+++ b/drivers/infiniband/hw/mlx5/qp.c@@ -3118,8 +3118,10 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, mlx5_new =to_mlx5_state (new_state);
drivers/infiniband/hw/mlx5/qp.c static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, · line 3127
Quoted 10 lines
drivers/infiniband/hw/mlx5/qp.c +3
-1if (mlx5_cur >=MLX5_QP_NUM_STATE || mlx5_new >=MLX5_QP_NUM_STATE || - !optab[mlx5_cur][mlx5_new]) + !optab[mlx5_cur][mlx5_new]) { + err = -EINVAL ; goto out; + } op = optab[mlx5_cur][mlx5_new]; optpar =ib_mask_to_mlx5_opt (attr_mask);
I applied this by hand to for-rc due to context changes
Thanks,
Jason