Commit 1d1ca9b4 authored by Steve Wise's avatar Steve Wise Committed by Roland Dreier

RDMA/cxgb4: Fix over-dereference when terminating

Need to get the endpoint reference before calling rdma_fini(), which
might fail causing us to not get the reference.
Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 97df1c67
...@@ -1389,6 +1389,7 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp, ...@@ -1389,6 +1389,7 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
qhp->attr.ecode = attrs->ecode; qhp->attr.ecode = attrs->ecode;
ep = qhp->ep; ep = qhp->ep;
disconnect = 1; disconnect = 1;
c4iw_get_ep(&qhp->ep->com);
if (!internal) if (!internal)
terminate = 1; terminate = 1;
else { else {
...@@ -1396,7 +1397,6 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp, ...@@ -1396,7 +1397,6 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
if (ret) if (ret)
goto err; goto err;
} }
c4iw_get_ep(&qhp->ep->com);
break; break;
case C4IW_QP_STATE_ERROR: case C4IW_QP_STATE_ERROR:
t4_set_wq_in_error(&qhp->wq); t4_set_wq_in_error(&qhp->wq);
......
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