Commit eec9e29fc5e9b417649830ab76a3aa10b90d2e9f

Authored by Shlomo Pongratz
Committed by Roland Dreier
1 parent 41ef2d5678

IB/core: Verify that QP handler is valid before dispatching events

For QPs of type IB_QPT_XRC_TGT the IB core assigns a common event
handler __ib_shared_qp_event_handler(), and the optionally supplied
event handler is stored. When the common handler is called it iterates
on all opened QPs and calles the original handlers without checking if
they are NULL.  Fix that.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

drivers/infiniband/core/verbs.c
... ... @@ -348,7 +348,8 @@
348 348 struct ib_qp *qp = context;
349 349  
350 350 list_for_each_entry(event->element.qp, &qp->open_list, open_list)
351   - event->element.qp->event_handler(event, event->element.qp->qp_context);
  351 + if (event->element.qp->event_handler)
  352 + event->element.qp->event_handler(event, event->element.qp->qp_context);
352 353 }
353 354  
354 355 static void __ib_insert_xrcd_qp(struct ib_xrcd *xrcd, struct ib_qp *qp)