aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-02-29 11:50:22 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-03-04 17:47:05 -0500
commit1b3cbec1dcb6747b587b40335f5de1d9e035063c (patch)
tree7e24a74ac0c8082581335c764b184e0ae027804e /drivers/base/power
parent7a8d37a37380e2b1500592d40b7ec384dbebe7a0 (diff)
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 <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index b0c16f6fc186..d887d5cb5bef 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)
428 428
429 mutex_unlock(&dpm_list_mtx); 429 mutex_unlock(&dpm_list_mtx);
430 error = suspend_device(dev, state); 430 error = suspend_device(dev, state);
431 mutex_lock(&dpm_list_mtx);
431 if (error) { 432 if (error) {
432 printk(KERN_ERR "Could not suspend device %s: " 433 printk(KERN_ERR "Could not suspend device %s: "
433 "error %d%s\n", 434 "error %d%s\n",
@@ -438,7 +439,6 @@ static int dpm_suspend(pm_message_t state)
438 "")); 439 ""));
439 break; 440 break;
440 } 441 }
441 mutex_lock(&dpm_list_mtx);
442 if (!list_empty(&dev->power.entry)) 442 if (!list_empty(&dev->power.entry))
443 list_move(&dev->power.entry, &dpm_off); 443 list_move(&dev->power.entry, &dpm_off);
444 } 444 }