]> git.baikalelectronics.ru Git - kernel.git/commit
PM: sleep: Fix error handling in dpm_prepare()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 16 Dec 2021 19:30:18 +0000 (20:30 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 17 Dec 2021 17:36:08 +0000 (18:36 +0100)
commit3d76d3f2f99e7003cb07105b1d1803bb0c5abf9e
treea13a16253b52bda4aec4b8f1490f1857eeeaae33
parentf4faf532b51b095af557f2b8dce62f42101c8b01
PM: sleep: Fix error handling in dpm_prepare()

Commit e1825cbd7e63 ("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: e1825cbd7e63 ("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>
drivers/base/power/main.c