mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
PM: sleep: Fix error handling in dpm_prepare()
Commit2aa36604e8("PM: sleep: Avoid calling put_device() under dpm_list_mtx") forgot to update the while () loop termination condition to also break the loop if error is nonzero, which causes the loop to become infinite if device_prepare() returns an error for one device. Add the missing !error check. Fixes:2aa36604e8("PM: sleep: Avoid calling put_device() under dpm_list_mtx") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reported-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Cc: All applicable <stable@vger.kernel.org>
This commit is contained in:
parent
2585cf9dfa
commit
544e737dea
|
|
@ -1902,7 +1902,7 @@ int dpm_prepare(pm_message_t state)
|
|||
device_block_probing();
|
||||
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
while (!list_empty(&dpm_list)) {
|
||||
while (!list_empty(&dpm_list) && !error) {
|
||||
struct device *dev = to_device(dpm_list.next);
|
||||
|
||||
get_device(dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user