Commit 847aef6f authored by Akinobu Mita's avatar Akinobu Mita Committed by Dave Jones

[CPUFREQ] acpi-cpufreq: add error handling for cpufreq_register_driver() error

add error handling for cpufreq_register_driver() error
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: cpufreq@lists.linux.org.uk
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 8d2d2051
......@@ -785,7 +785,11 @@ static int __init acpi_cpufreq_init(void)
if (ret)
return ret;
return cpufreq_register_driver(&acpi_cpufreq_driver);
ret = cpufreq_register_driver(&acpi_cpufreq_driver);
if (ret)
free_percpu(acpi_perf_data);
return ret;
}
static void __exit acpi_cpufreq_exit(void)
......@@ -795,8 +799,6 @@ static void __exit acpi_cpufreq_exit(void)
cpufreq_unregister_driver(&acpi_cpufreq_driver);
free_percpu(acpi_perf_data);
return;
}
module_param(acpi_pstate_strict, uint, 0644);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment