提交 676121fc 编写于 作者: B Ben Collins 提交者: Linus Torvalds

[PATCH] Unchecked alloc_percpu() return in __create_workqueue()

__create_workqueue() not checking return of alloc_percpu()

NULL dereference was possible.
Signed-off-by: NBen Collins <bcollins@ubuntu.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 9fa37fd1
......@@ -315,6 +315,11 @@ struct workqueue_struct *__create_workqueue(const char *name,
return NULL;
wq->cpu_wq = alloc_percpu(struct cpu_workqueue_struct);
if (!wq->cpu_wq) {
kfree(wq);
return NULL;
}
wq->name = name;
/* We don't need the distraction of CPUs appearing and vanishing. */
lock_cpu_hotplug();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册