aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBen Collins <bcollins@debian.org>2006-01-08 04:03:04 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:13:54 -0500
commit676121fcb66c861804e38d94214fd5670a1ef595 (patch)
tree7b0f9d34efd5e1cb9b6b595aedcd9419942b5055 /kernel
parent9fa37fd1627ec804e57ae0388555719b03b39f20 (diff)
[PATCH] Unchecked alloc_percpu() return in __create_workqueue()
__create_workqueue() not checking return of alloc_percpu() NULL dereference was possible. Signed-off-by: Ben Collins <bcollins@ubuntu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/workqueue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 62d47220696a..e72fb6478da6 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -315,6 +315,11 @@ struct workqueue_struct *__create_workqueue(const char *name,
315 return NULL; 315 return NULL;
316 316
317 wq->cpu_wq = alloc_percpu(struct cpu_workqueue_struct); 317 wq->cpu_wq = alloc_percpu(struct cpu_workqueue_struct);
318 if (!wq->cpu_wq) {
319 kfree(wq);
320 return NULL;
321 }
322
318 wq->name = name; 323 wq->name = name;
319 /* We don't need the distraction of CPUs appearing and vanishing. */ 324 /* We don't need the distraction of CPUs appearing and vanishing. */
320 lock_cpu_hotplug(); 325 lock_cpu_hotplug();