提交 1b3cbec1 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

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: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7a8d37a3
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册