Skip to content

Commit

Permalink
PM: fix new mutex-locking bug in the PM core
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Mar 4, 2008
1 parent 7a8d37a commit 1b3cbec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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);
}
Expand Down

0 comments on commit 1b3cbec

Please sign in to comment.