From 0f5896a797eb3630f0e159ebb43f3a780489385e Mon Sep 17 00:00:00 2001 From: leonidk Date: Wed, 16 Aug 2006 09:51:51 +0000 Subject: [PATCH] [MTHCA] bugfix: skip handling events on absence of a client (e.g., when PORT_CHANGE async event comes after IBBUS has been unloaded) git-svn-id: svn://openib.tc.cornell.edu/gen1@457 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mthca/kernel/hca_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trunk/hw/mthca/kernel/hca_data.c b/trunk/hw/mthca/kernel/hca_data.c index 5d29dca2..96f6ea15 100644 --- a/trunk/hw/mthca/kernel/hca_data.c +++ b/trunk/hw/mthca/kernel/hca_data.c @@ -322,7 +322,7 @@ void cq_comp_handler(struct ib_cq *cq, void *context) mlnx_hob_t *hob_p = (mlnx_hob_t *)context; struct mthca_cq *mcq =(struct mthca_cq *)cq; HCA_ENTER(HCA_DBG_CQ); - if (hob_p) { + if (hob_p && hob_p->comp_cb_p) { HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_CQ ,("Invoking completion callback\n")); (hob_p->comp_cb_p)(mcq->cq_context); } @@ -349,7 +349,7 @@ void ca_event_handler(struct ib_event *ev, void *context) } // call the user callback - if (hob_p) + if (hob_p && hob_p->async_cb_p) (hob_p->async_cb_p)(&event_rec); else { HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_SHIM ,("Incorrect context. Async callback was not invoked\n")); -- 2.41.0