From b4ad84fc91d47b7b6c2674abf776068a118a7726 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 10 May 2004 00:03:20 -0700 Subject: [PATCH] fix deadlock in create_workqueue() Fix bug identified by Srivatsa Vaddagiri : There's a deadlock in __create_workqueue when CONFIG_HOTPLUG_CPU is set. This can happen when create_workqueue_thread fails to create a worker thread. In that case, we call destroy_workqueue with cpu hotplug lock held. destroy_workqueue however also attempts to take the same lock. --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/workqueue.c') diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 162aca1f4822..8c0be4dc39bb 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -334,6 +334,7 @@ struct workqueue_struct *__create_workqueue(const char *name, destroy = 1; } } + unlock_cpu_hotplug(); /* * Was there any error during startup? If yes then clean up: @@ -342,7 +343,6 @@ struct workqueue_struct *__create_workqueue(const char *name, destroy_workqueue(wq); wq = NULL; } - unlock_cpu_hotplug(); return wq; } -- cgit v1.2.3