Loading
PM: sleep: Fix error handling in dpm_prepare()
stable inclusion from stable-v5.10.210 commit 6db18971f73a8312ec547c32274c398e6ca36e14 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I97NIA CVE: CVE-2023-52498 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6db18971f73a8312ec547c32274c398e6ca36e14 -------------------------------- [ Upstream commit 544e737d ] Commit 2aa36604 ("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: 2aa36604 ("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> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>