mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 14/15] workqueue: Check return of alloc_percpu().
@ 2006-01-04 22:01 Ben Collins
  0 siblings, 0 replies; only message in thread
From: Ben Collins @ 2006-01-04 22:01 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Ben Collins <bcollins@ubuntu.com>

---

 kernel/workqueue.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

7d2b5b2a0fd4293aa49326b9bf03ca11610f9030
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 2bd5aee..a5e3e8a 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -315,6 +315,11 @@ struct workqueue_struct *__create_workqu
 		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();
-- 
1.0.5

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-04 22:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-04 22:01 [PATCH 14/15] workqueue: Check return of alloc_percpu() Ben Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome