Skip to content

Commit

Permalink
RDMA/rxe: Fix double unlock in rxe_qp.c
Browse files Browse the repository at this point in the history
A recent patch can cause a double spin_unlock_bh() in rxe_qp_to_attr() at
line 715 in rxe_qp.c. Move the 2nd unlock into the if statement.

Fixes: f605f26 ("RDMA/rxe: Protect QP state with qp->state_lock")
Link: https://lore.kernel.org/r/20230515201056.1591140-1-rpearsonhpe@gmail.com
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/27773078-40ce-414f-8b97-781954da9f25@kili.mountain
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Bob Pearson authored and jgunthorpe committed May 16, 2023
1 parent 78b6a9a commit 17eabd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/sw/rxe/rxe_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,9 @@ int rxe_qp_to_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask)
if (qp->attr.sq_draining) {
spin_unlock_bh(&qp->state_lock);
cond_resched();
} else {
spin_unlock_bh(&qp->state_lock);
}
spin_unlock_bh(&qp->state_lock);

return 0;
}
Expand Down

0 comments on commit 17eabd6

Please sign in to comment.