RDMA/nes: Don't call event handler if pointer is NULL
authorTatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Fri, 11 May 2012 19:29:32 +0000 (14:29 -0500)
committerRoland Dreier <roland@purestorage.com>
Mon, 14 May 2012 19:48:07 +0000 (12:48 -0700)
Don't call the ibqp event_handler pointer in the case it wasn't initialized.

Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Donald Wood <Donald.E.Wood@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/nes/nes_cm.c

index 5c10cbfa2668824239e810289f7d2a60f314fb35..020e95c4c4b9b08da6119b13bbe6b8b6a2710b88 100644 (file)
@@ -2884,7 +2884,8 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
                        ibevent.device = nesqp->ibqp.device;
                        ibevent.event = nesqp->terminate_eventtype;
                        ibevent.element.qp = &nesqp->ibqp;
-                       nesqp->ibqp.event_handler(&ibevent, nesqp->ibqp.qp_context);
+                       if (nesqp->ibqp.event_handler)
+                               nesqp->ibqp.event_handler(&ibevent, nesqp->ibqp.qp_context);
                }
        }