Skip to content

Commit eec9e29

Browse files
shlomopongratzrolandd
authored andcommitted
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>
1 parent 41ef2d5 commit eec9e29

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/infiniband/core/verbs.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ static void __ib_shared_qp_event_handler(struct ib_event *event, void *context)
348348
struct ib_qp *qp = context;
349349

350350
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);
352353
}
353354

354355
static void __ib_insert_xrcd_qp(struct ib_xrcd *xrcd, struct ib_qp *qp)

0 commit comments

Comments
 (0)