mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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 <[email protected]> Reported-by: Thomas Hellström <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Cc: All applicable <[email protected]>