提交 17eabd6a 编写于 作者: B Bob Pearson 提交者: Jason Gunthorpe

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: f605f26e ("RDMA/rxe: Protect QP state with qp->state_lock")
Link: https://lore.kernel.org/r/20230515201056.1591140-1-rpearsonhpe@gmail.comReported-by: NDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/27773078-40ce-414f-8b97-781954da9f25@kili.mountainSigned-off-by: NBob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
上级 78b6a9a3
...@@ -712,8 +712,9 @@ int rxe_qp_to_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask) ...@@ -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) { if (qp->attr.sq_draining) {
spin_unlock_bh(&qp->state_lock); spin_unlock_bh(&qp->state_lock);
cond_resched(); cond_resched();
} else {
spin_unlock_bh(&qp->state_lock);
} }
spin_unlock_bh(&qp->state_lock);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册