[MTHCA] bugfix: skip handling events on absence of a client (e.g., when PORT_CHANGE...
[mirror/winof/.git] / hw / mthca / kernel / hca_data.c
index 5d29dca..96f6ea1 100644 (file)
@@ -322,7 +322,7 @@ void cq_comp_handler(struct ib_cq *cq, void *context)
        mlnx_hob_t *hob_p = (mlnx_hob_t *)context;\r
        struct mthca_cq *mcq =(struct mthca_cq *)cq; \r
        HCA_ENTER(HCA_DBG_CQ);\r
-       if (hob_p) {\r
+       if (hob_p && hob_p->comp_cb_p) {\r
                HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_CQ ,("Invoking completion callback\n"));\r
                (hob_p->comp_cb_p)(mcq->cq_context);\r
        }\r
@@ -349,7 +349,7 @@ void ca_event_handler(struct ib_event *ev, void *context)
        }\r
 \r
        // call the user callback\r
-       if (hob_p)\r
+       if (hob_p && hob_p->async_cb_p)\r
                (hob_p->async_cb_p)(&event_rec);\r
        else {\r
                HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("Incorrect context. Async callback was not invoked\n"));\r