Skip to contentSkip to conversation

i40iw: Add NULL check for ibqp event handler

PATCH New Henry Orosco 1 participant 1 message Nov 30, 2016 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40iw: Add NULL check for ibqp event handler

From: Shiraz Saleem <[email protected]>

Add NULL check for ibqp event handler before calling it to report QP events, as it might not initialized.

---
 drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/i40iw/i40iw_cm.c +1 -1
index 9a14880..13b6dee 100644
@@ -3474,7 +3474,7 @@ static void i40iw_cm_disconn_true(struct i40iw_qp *iwqp)
 		/* Flush the queues */
 		i40iw_flush_wqes(iwdev, iwqp);
 
-		if (qp->term_flags) {
+		if (qp->term_flags && iwqp->ibqp.event_handler) {
 			ibevent.device = iwqp->ibqp.device;
 			ibevent.event = (qp->eventtype == TERM_EVENT_QP_FATAL) ?
 					IB_EVENT_QP_FATAL : IB_EVENT_QP_ACCESS_ERR;
Signature · 6 lines
2.8.3

--
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