Skip to content

Commit 17eabd6

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Fix double unlock in rxe_qp.c
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/[email protected] Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 78b6a9a commit 17eabd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/sw/rxe/rxe_qp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,9 @@ int rxe_qp_to_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask)
712712
if (qp->attr.sq_draining) {
713713
spin_unlock_bh(&qp->state_lock);
714714
cond_resched();
715+
} else {
716+
spin_unlock_bh(&qp->state_lock);
715717
}
716-
spin_unlock_bh(&qp->state_lock);
717718

718719
return 0;
719720
}

0 commit comments

Comments
 (0)