Commit d6d5c599 authored by Sriharsha Basavapatna's avatar Sriharsha Basavapatna Committed by Doug Ledford

bnxt_re: fix a crash in qp error event processing

In bnxt_qplib_process_qp_event(), for qp error events we look up the
qp-handle and pass it for further processing. But we don't check if the
handle is NULL. This could lead to a crash in the called functions when
that qp-handle is dereferenced, if the qp is destroyed in the meantime.
Fix this by checking for a valid qp-handle in that function.
Signed-off-by: default avatarSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent f17966f1
...@@ -302,6 +302,8 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, ...@@ -302,6 +302,8 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
"QPLIB: qpid 0x%x, req_err=0x%x, resp_err=0x%x\n", "QPLIB: qpid 0x%x, req_err=0x%x, resp_err=0x%x\n",
qp_id, err_event->req_err_state_reason, qp_id, err_event->req_err_state_reason,
err_event->res_err_state_reason); err_event->res_err_state_reason);
if (!qp)
break;
bnxt_qplib_acquire_cq_locks(qp, &flags); bnxt_qplib_acquire_cq_locks(qp, &flags);
bnxt_qplib_mark_qp_error(qp); bnxt_qplib_mark_qp_error(qp);
bnxt_qplib_release_cq_locks(qp, &flags); bnxt_qplib_release_cq_locks(qp, &flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment