]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i40iw: Add NULL check for ibqp event handler
authorShiraz Saleem <shiraz.saleem@intel.com>
Wed, 30 Nov 2016 21:09:07 +0000 (15:09 -0600)
committerDoug Ledford <dledford@redhat.com>
Mon, 5 Dec 2016 21:09:42 +0000 (16:09 -0500)
Add NULL check for ibqp event handler before calling it to report
QP events, as it might not initialized.

Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c

index 9a14880fe85a4dba32d1a2260f103946a1c83376..13b6dee4d57c304ffd1b37fd7b739151192919f7 100644 (file)
@@ -3474,7 +3474,7 @@ static void i40iw_cm_disconn_true(struct i40iw_qp *iwqp)
                /* Flush the queues */
                i40iw_flush_wqes(iwdev, iwqp);
 
-               if (qp->term_flags) {
+               if (qp->term_flags && iwqp->ibqp.event_handler) {
                        ibevent.device = iwqp->ibqp.device;
                        ibevent.event = (qp->eventtype == TERM_EVENT_QP_FATAL) ?
                                        IB_EVENT_QP_FATAL : IB_EVENT_QP_ACCESS_ERR;