Re: [PATCH] ACPI: processor: Unregister cpufreq notifier on init failure

"Rafael J. Wysocki (Intel)" <[email protected]> Fri, 31 Jul 2026 14:49:21 +0200
Newsgroups gmane.linux.kernel,gmane.linux.acpi.devel
Message-ID <CAJZ5v0jHVCtac+=M1Qqzu88ynzjSco9EZVp6+7e=c=2iP1vrsg@mail.gmail.com>
On Wed, Jul 29, 2026 at 4:36=E2=80=AFAM Can Peng <[email protected]> wrote=
:
>
> 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 <[email protected]>
> ---
>  drivers/acpi/processor_driver.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_dri=
ver.c
> index cda8fd720000..cdc2ae1632b2 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -285,6 +285,12 @@ static int __init acpi_processor_driver_init(void)
>  unregister_idle_drv:
>         acpi_processor_unregister_idle_driver();
>
> +       if (acpi_processor_cpufreq_init) {
> +               cpufreq_unregister_notifier(&acpi_processor_notifier_bloc=
k,
> +                                           CPUFREQ_POLICY_NOTIFIER);
> +               acpi_processor_cpufreq_init =3D false;
> +       }
> +
>         return result;
>  }
>
> --

Applied as 7.3 material, thanks!