workqueue: Check return of alloc_percpu().
PATCH 14/15 workqueue: Check return of alloc_percpu().
Signed-off-by Ben Collins <[email protected]>
---
kernel/workqueue.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
7d2b5b2a0fd4293aa49326b9bf03ca11610f9030
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 · 1 line
1.0.5