Skip to content

Commit 863b7eb

Browse files
kkaneshigejbarnes993
authored andcommitted
PCI: pciehp: Fix wrong workqueue cleanup
Fix improper workqueue cleanup. In the current pciehp, pcied_cleanup() calls destroy_workqueue() before calling pcie_port_service_unregister(). This causes kernel oops because flush_workqueue() is called in the pcie_port_service_unregister() code path after the workqueue was destroyed. So pcied_cleanup() must call pcie_port_service_unregister() first before calling destroy_workqueue(). Signed-off-by: Kenji Kaneshige <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
1 parent 10f6dc7 commit 863b7eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/hotplug/pciehp_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@ static int __init pcied_init(void)
366366
static void __exit pcied_cleanup(void)
367367
{
368368
dbg("unload_pciehpd()\n");
369+
pcie_port_service_unregister(&hpdriver_portdrv);
369370
destroy_workqueue(pciehp_ordered_wq);
370371
destroy_workqueue(pciehp_wq);
371-
pcie_port_service_unregister(&hpdriver_portdrv);
372372
info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
373373
}
374374

0 commit comments

Comments
 (0)