diff options
| author | Kashyap Desai <[email protected]> | 2024-10-08 07:41:35 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2024-10-11 23:49:01 +0000 |
| commit | 87b4d8d28f6af8fc62766a8af7a5467b37053dfa (patch) | |
| tree | 0158069f35d9c4ab5b075c027990632d4e72e7fe /drivers/infiniband/hw/bnxt_re/main.c | |
| parent | RDMA/bnxt_re: Fix out of bound check (diff) | |
| download | kernel-87b4d8d28f6af8fc62766a8af7a5467b37053dfa.tar.gz kernel-87b4d8d28f6af8fc62766a8af7a5467b37053dfa.zip | |
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: b02fd3f79ec3 ("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]>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/main.c')
| -rw-r--r-- | drivers/infiniband/hw/bnxt_re/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 686e405f22b4..dd39948c016c 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1028,12 +1028,15 @@ static int bnxt_re_handle_unaffi_async_event(struct creq_func_event static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event, struct bnxt_re_qp *qp) { - struct bnxt_re_srq *srq = container_of(qp->qplib_qp.srq, struct bnxt_re_srq, - qplib_srq); struct creq_qp_error_notification *err_event; + struct bnxt_re_srq *srq = NULL; struct ib_event event = {}; unsigned int flags; + if (qp->qplib_qp.srq) + srq = container_of(qp->qplib_qp.srq, struct bnxt_re_srq, + qplib_srq); + if (qp->qplib_qp.state == CMDQ_MODIFY_QP_NEW_STATE_ERR && rdma_is_kernel_res(&qp->ib_qp.res)) { flags = bnxt_re_lock_cqs(qp); |
