Commit 507b8200 authored by Kangjie Lu's avatar Kangjie Lu Committed by Lorenzo Pieralisi

PCI: endpoint: Fix a potential NULL pointer dereference

In case alloc_workqueue() fails, return -ENOMEM to avoid
potential NULL pointer dereferences.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
[lorenzo.pieralisi@arm.com: commit log and code update]
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
parent 993d5fe3
......@@ -591,6 +591,11 @@ static int __init pci_epf_test_init(void)
kpcitest_workqueue = alloc_workqueue("kpcitest",
WQ_MEM_RECLAIM | WQ_HIGHPRI, 0);
if (!kpcitest_workqueue) {
pr_err("Failed to allocate the kpcitest work queue\n");
return -ENOMEM;
}
ret = pci_epf_register_driver(&test_driver);
if (ret) {
pr_err("Failed to register pci epf test driver --> %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment