Skip to content

Commit 079e888

Browse files
committed
PM: sleep: Fix list splicing in device suspend error paths
Commits aa7a927 ("PM: sleep: Suspend async parents after suspending children") and 443046d ("PM: sleep: Make suspend of devices more asynchronous") added list splicing to the error paths of dpm_suspend(), dpm_suspend_late(), and dpm_noirq_suspend_devices(), but they should have used the list_splice_init() variant because the emptied list is used going forward in all of these cases. Replace list_splice() with list_splice_init() in the code in question as appropriate. Fixes: aa7a927 ("PM: sleep: Suspend async parents after suspending children") Fixes: 443046d ("PM: sleep: Make suspend of devices more asynchronous") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/4280 Reported-and-tested-by: Chris Bainbridge <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 976aa63 commit 079e888

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/base/power/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ static int dpm_noirq_suspend_devices(pm_message_t state)
14511451
* Move all devices to the target list to resume them
14521452
* properly.
14531453
*/
1454-
list_splice(&dpm_late_early_list, &dpm_noirq_list);
1454+
list_splice_init(&dpm_late_early_list, &dpm_noirq_list);
14551455
break;
14561456
}
14571457
}
@@ -1653,7 +1653,7 @@ int dpm_suspend_late(pm_message_t state)
16531653
* Move all devices to the target list to resume them
16541654
* properly.
16551655
*/
1656-
list_splice(&dpm_suspended_list, &dpm_late_early_list);
1656+
list_splice_init(&dpm_suspended_list, &dpm_late_early_list);
16571657
break;
16581658
}
16591659
}
@@ -1946,7 +1946,7 @@ int dpm_suspend(pm_message_t state)
19461946
* Move all devices to the target list to resume them
19471947
* properly.
19481948
*/
1949-
list_splice(&dpm_prepared_list, &dpm_suspended_list);
1949+
list_splice_init(&dpm_prepared_list, &dpm_suspended_list);
19501950
break;
19511951
}
19521952
}

0 commit comments

Comments
 (0)