Unchecked alloc_percpu() return in __create_workqueue()
PATCH 1/1 Unchecked alloc_percpu() return in __create_workqueue()
[UBUNTU:kernel/workqueue] __create_workqueue() not checking return of alloc_percpu()
NULL dereference was possible.
Signed-off-by Ben Collins <[email protected]>
kernel/workqueue.c +5 -0
@@ -315,6 +315,11 @@ struct workqueue_struct *__create_workqureturn 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 ();
Signature · 4 lines
Ubuntu - http://www.ubuntu.com/ Debian - http://www.debian.org/ Linux 1394 - http://www.linux1394.org/ SwissDisk - http://www.swissdisk.com/