Skip to content

Commit

Permalink
RDMA/cxgb4: Fix over-dereference when terminating
Browse files Browse the repository at this point in the history
Need to get the endpoint reference before calling rdma_fini(), which
might fail causing us to not get the reference.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Steve Wise authored and Roland Dreier committed Apr 11, 2014
1 parent 97df1c6 commit 1d1ca9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/cxgb4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,14 +1389,14 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
qhp->attr.ecode = attrs->ecode;
ep = qhp->ep;
disconnect = 1;
c4iw_get_ep(&qhp->ep->com);
if (!internal)
terminate = 1;
else {
ret = rdma_fini(rhp, qhp, ep);
if (ret)
goto err;
}
c4iw_get_ep(&qhp->ep->com);
break;
case C4IW_QP_STATE_ERROR:
t4_set_wq_in_error(&qhp->wq);
Expand Down

0 comments on commit 1d1ca9b

Please sign in to comment.