mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
PCI: endpoint: Fix missing destroy_workqueue()
Add the missing destroy_workqueue() before return from
pci_epf_test_init() in the error handling case and add
destroy_workqueue() in pci_epf_test_exit().
Link: https://lore.kernel.org/r/20210331084012.2091010-1-yangyingliang@huawei.com
Fixes: 349e7a85b2
("PCI: endpoint: functions: Add an EP function to test PCI")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
This commit is contained in:
parent
80c253bd7f
commit
acaef7981a
@ -925,6 +925,7 @@ static int __init pci_epf_test_init(void)
|
||||
|
||||
ret = pci_epf_register_driver(&test_driver);
|
||||
if (ret) {
|
||||
destroy_workqueue(kpcitest_workqueue);
|
||||
pr_err("Failed to register pci epf test driver --> %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
@ -935,6 +936,8 @@ module_init(pci_epf_test_init);
|
||||
|
||||
static void __exit pci_epf_test_exit(void)
|
||||
{
|
||||
if (kpcitest_workqueue)
|
||||
destroy_workqueue(kpcitest_workqueue);
|
||||
pci_epf_unregister_driver(&test_driver);
|
||||
}
|
||||
module_exit(pci_epf_test_exit);
|
||||
|
Loading…
Reference in New Issue
Block a user