aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds2021-12-21 12:31:55 -0800
committerLinus Torvalds2021-12-21 12:31:55 -0800
commit2f47a9a4dfa3674fad19a49b40c5103a9a8e1589 (patch)
treea0b62248d1b4251ab13b28753911fb13cb0d4e39
parentca0ea8a60b40ecde7362ce295408c5038599f5d0 (diff)
parent544e737dea5ad1a457f25dbddf68761ff25e028b (diff)
Merge tag 'pm-5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fix from Rafael Wysocki: "Fix a recent regression causing the loop in dpm_prepare() to become infinite if one of the device ->prepare() callbacks returns an error" * tag 'pm-5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: sleep: Fix error handling in dpm_prepare()
-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 f4d0c555de29..04ea92cbd9cf 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -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);