Skip to content

Commit 87b4d8d

Browse files
kadesai16jgunthorpe
authored andcommitted
RDMA/bnxt_re: Fix incorrect dereference of srq in async event
Currently driver is not getting correct srq. Dereference only if qplib has a valid srq. Fixes: b02fd3f ("RDMA/bnxt_re: Report async events and errors") Link: https://patch.msgid.link/r/[email protected] Reviewed-by: Saravanan Vajravel <[email protected]> Reviewed-by: Chandramohan Akula <[email protected]> Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent a9e6e74 commit 87b4d8d

File tree

1 file changed

+5
-2
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+5
-2
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,12 +1028,15 @@ static int bnxt_re_handle_unaffi_async_event(struct creq_func_event
10281028
static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event,
10291029
struct bnxt_re_qp *qp)
10301030
{
1031-
struct bnxt_re_srq *srq = container_of(qp->qplib_qp.srq, struct bnxt_re_srq,
1032-
qplib_srq);
10331031
struct creq_qp_error_notification *err_event;
1032+
struct bnxt_re_srq *srq = NULL;
10341033
struct ib_event event = {};
10351034
unsigned int flags;
10361035

1036+
if (qp->qplib_qp.srq)
1037+
srq = container_of(qp->qplib_qp.srq, struct bnxt_re_srq,
1038+
qplib_srq);
1039+
10371040
if (qp->qplib_qp.state == CMDQ_MODIFY_QP_NEW_STATE_ERR &&
10381041
rdma_is_kernel_res(&qp->ib_qp.res)) {
10391042
flags = bnxt_re_lock_cqs(qp);

0 commit comments

Comments
 (0)