mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
7a8d37a373
commit
1b3cbec1dc
|
@ -428,6 +428,7 @@ static int dpm_suspend(pm_message_t state)
|
||||||
|
|
||||||
mutex_unlock(&dpm_list_mtx);
|
mutex_unlock(&dpm_list_mtx);
|
||||||
error = suspend_device(dev, state);
|
error = suspend_device(dev, state);
|
||||||
|
mutex_lock(&dpm_list_mtx);
|
||||||
if (error) {
|
if (error) {
|
||||||
printk(KERN_ERR "Could not suspend device %s: "
|
printk(KERN_ERR "Could not suspend device %s: "
|
||||||
"error %d%s\n",
|
"error %d%s\n",
|
||||||
|
@ -438,7 +439,6 @@ static int dpm_suspend(pm_message_t state)
|
||||||
""));
|
""));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mutex_lock(&dpm_list_mtx);
|
|
||||||
if (!list_empty(&dev->power.entry))
|
if (!list_empty(&dev->power.entry))
|
||||||
list_move(&dev->power.entry, &dpm_off);
|
list_move(&dev->power.entry, &dpm_off);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue