diff options
| author | Can Peng <pengcan@kylinos.cn> | 2026-07-29 10:36:05 +0800 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-07-31 14:47:34 +0200 |
| commit | 06f32dd67e6b23a05bef0d8183c5335af91c0c3b (patch) | |
| tree | 37f9c28fd2861bb373922a8662d98491a1db1029 | |
| parent | 2c50ffdc73f3a70d745d249f509fc290754121e6 (diff) | |
| download | linux-next-06f32dd67e6b23a05bef0d8183c5335af91c0c3b.tar.gz linux-next-06f32dd67e6b23a05bef0d8183c5335af91c0c3b.zip | |
ACPI: processor: Unregister cpufreq notifier on init failure
acpi_processor_driver_init() registers the cpufreq policy notifier before
registering the ACPI processor driver and setting up CPU hotplug state.
If driver_register() or cpuhp_setup_state() fails, the error path only
unregisters the ACPI processor driver and the idle driver. The cpufreq
notifier remains registered even though initialization failed.
Mirror the module exit path on the init failure path and unregister the
cpufreq notifier when it has been registered.
Fixes: c0e0421a60bf ("ACPI: processor: Reorder acpi_processor_driver_init()")
Signed-off-by: Can Peng <pengcan@kylinos.cn>
Link: https://patch.msgid.link/20260729023605.197367-1-pengcan@kylinos.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | drivers/acpi/processor_driver.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index cda8fd720000..cdc2ae1632b2 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -285,6 +285,12 @@ err: unregister_idle_drv: acpi_processor_unregister_idle_driver(); + if (acpi_processor_cpufreq_init) { + cpufreq_unregister_notifier(&acpi_processor_notifier_block, + CPUFREQ_POLICY_NOTIFIER); + acpi_processor_cpufreq_init = false; + } + return result; } |
