提交 56798b02 编写于 作者: K Kangjie Lu 提交者: Xie XiuQi

PCI: endpoint: Fix a potential NULL pointer dereference

mainline inclusion
from mainline-5.1-rc1
commit 507b820009a4
category: bugfix
bugzilla: 16035
CVE: NA

-------------------------------------------------

In case alloc_workqueue() fails, return -ENOMEM to avoid
potential NULL pointer dereferences.
Signed-off-by: NKangjie Lu <kjlu@umn.edu>
[lorenzo.pieralisi@arm.com: commit log and code update]
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NYao Hongbo <yaohongbo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7558f005
......@@ -570,6 +570,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册