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/1728373302-19530-4-git-send-email-selvin.xavier@broadcom.com Reviewed-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com> Reviewed-by: Chandramohan Akula <chandramohan.akula@broadcom.com> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent a9e6e74 commit 87b4d8d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • drivers/infiniband/hw/bnxt_re

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)