]> git.baikalelectronics.ru Git - kernel.git/commit
cpuidle: psci: Fix error path via converting to a platform driver
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 7 Jul 2020 12:58:02 +0000 (14:58 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 29 Jul 2020 16:38:30 +0000 (18:38 +0200)
commit4e5ef0b7918bcf19b51e51ef9a54a2665b6b99c9
treec1091d91601801ef65bd7ceca83397acec194520
parent2a98641e152f8b9f65ae5d21860d1386ea417b13
cpuidle: psci: Fix error path via converting to a platform driver

The current error paths for the cpuidle-psci driver, may leak memory or
possibly leave CPU devices attached to their PM domains. These are quite
harmless issues, but still deserves to be taken care of.

Although, rather than fixing them by keeping track of allocations that
needs to be freed, which tends to become a bit messy, let's convert into a
platform driver. In this way, it gets easier to fix the memory leaks as we
can rely on the devm_* functions.

Moreover, converting to a platform driver also enables support for deferred
probe, which subsequent changes takes benefit from.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/cpuidle-psci-domain.c
drivers/cpuidle/cpuidle-psci.c
drivers/cpuidle/cpuidle-psci.h