提交 d2eb8174 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

drm/amdkfd: check kfd->ih_wq in kfd_interrupt_init()

hulk inclusion
category: bugfix
bugzilla: 13690
CVE: CVE-2019-16229

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

There are multiple points in the Linux Kernel where alloc_workqueue is
not getting checked for errors and as a result, a potential NULL
dereference could occur.
https://lkml.org/lkml/2019/9/9/487Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6ac725c4
...@@ -62,6 +62,11 @@ int kfd_interrupt_init(struct kfd_dev *kfd) ...@@ -62,6 +62,11 @@ int kfd_interrupt_init(struct kfd_dev *kfd)
} }
kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI, 1); kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI, 1);
if (!kfd->ih_wq) {
kfifo_free(&kfd->ih_fifo);
dev_err(kfd_chardev(), "Failed to allocate KFD IH workqueue\n");
return -ENOMEM;
}
spin_lock_init(&kfd->interrupt_lock); spin_lock_init(&kfd->interrupt_lock);
INIT_WORK(&kfd->interrupt_work, interrupt_wq); INIT_WORK(&kfd->interrupt_work, interrupt_wq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册