From: Shlomo Pongratz <shlo...@mellanox.com>

For QPs of type IB_QPT_XRC_TGT the IB core assigns a common event handler
__ib_shared_qp_event_handler, and the optionally supplied event handler
is stored. When the common handler is called it iterates on all opened
QPs and calles the original handlers without checking if they are
NULL, fix that.

Signed-off-by: Shlomo Pongratz <shlo...@mellanox.com>
Signed-off-by: Or Gerlitz <ogerl...@mellanox.com>
---
 drivers/infiniband/core/verbs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index a8fdd33..22192de 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -348,7 +348,8 @@ static void __ib_shared_qp_event_handler(struct ib_event 
*event, void *context)
        struct ib_qp *qp = context;
 
        list_for_each_entry(event->element.qp, &qp->open_list, open_list)
-               event->element.qp->event_handler(event, 
event->element.qp->qp_context);
+               if (event->element.qp->event_handler)
+                       event->element.qp->event_handler(event, 
event->element.qp->qp_context);
 }
 
 static void __ib_insert_xrcd_qp(struct ib_xrcd *xrcd, struct ib_qp *qp)
-- 
1.7.1

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

Reply via email to