Skip to content

Commit

Permalink
IB/mlx5: Fix an error code in __mlx5_ib_modify_qp()
Browse files Browse the repository at this point in the history
"err" is either zero or possibly uninitialized here.  It should be
-EINVAL.

Fixes: 427c1e7 ("{IB, net}/mlx5: Move the modify QP operation table to mlx5_ib")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Dan Carpenter authored and Jason Gunthorpe committed Mar 7, 2018
1 parent 210b1f7 commit 5d414b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/hw/mlx5/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3100,8 +3100,10 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
goto out;

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);
Expand Down

0 comments on commit 5d414b1

Please sign in to comment.