From 1b3cbec1dcb6747b587b40335f5de1d9e035063c Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 29 Feb 2008 11:50:22 -0500 Subject: PM: fix new mutex-locking bug in the PM core This patch (as1041) fixes a bug introduced by the acquire-all-device-semaphores reversion. The error pathway of dpm_suspend() fails to reacquire a mutex it should be holding. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/base/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index b0c16f6..d887d5c 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -428,6 +428,7 @@ static int dpm_suspend(pm_message_t state) mutex_unlock(&dpm_list_mtx); error = suspend_device(dev, state); + mutex_lock(&dpm_list_mtx); if (error) { printk(KERN_ERR "Could not suspend device %s: " "error %d%s\n", @@ -438,7 +439,6 @@ static int dpm_suspend(pm_message_t state) "")); break; } - mutex_lock(&dpm_list_mtx); if (!list_empty(&dev->power.entry)) list_move(&dev->power.entry, &dpm_off); } -- cgit v1.1