From: Tatyana Nikolova Date: Fri, 11 May 2012 19:29:32 +0000 (-0500) Subject: RDMA/nes: Don't call event handler if pointer is NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=784d135f967849cb51c7e8d0c5230734f893331c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git RDMA/nes: Don't call event handler if pointer is NULL Don't call the ibqp event_handler pointer in the case it wasn't initialized. Signed-off-by: Tatyana Nikolova Signed-off-by: Donald Wood Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 5c10cbfa2668..020e95c4c4b9 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -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); } }