Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f47ae0b authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier
Browse files

IB/sa_query: Flush scheduled work before unloading module



sa_query schedules work on IB asynchronous events.  After
unregistering the async event handler, make sure that this work has
completed before releasing the IB device (and possibly allowing the
sa_query module text to go away).

Signed-off-by: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent cc76e33e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -956,6 +956,8 @@ static void ib_sa_remove_one(struct ib_device *device)

	ib_unregister_event_handler(&sa_dev->event_handler);

	flush_scheduled_work();

	for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
		ib_unregister_mad_agent(sa_dev->port[i].agent);
		kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);