Skip to contentSkip to conversation

iw_cxgb4: fix over-dereference when terminating

PATCH New Steve Wise 1 participant 1 message Apr 2, 2014

Subsystems (2)
lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/1 iw_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.

---

 drivers/infiniband/hw/cxgb4/qp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/infiniband/hw/cxgb4/qp.c +1 -1
index 723ad29..7dc6ea1 100644
@@ -1352,6 +1352,7 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
 			t4_set_wq_in_error(&qhp->wq);
 			ep = qhp->ep;
 			disconnect = 1;
+			c4iw_get_ep(&qhp->ep->com);
 			if (!internal)
 				terminate = 1;
 			else {
@@ -1359,7 +1360,6 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
 				if (ret)
 					goto err;
 			}
-			c4iw_get_ep(&qhp->ep->com);
 			break;
 		case C4IW_QP_STATE_ERROR:
 			set_state(qhp, C4IW_QP_STATE_ERROR);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html