From: Viresh Kumar Date: Thu, 7 Apr 2016 08:36:58 +0000 (+0530) Subject: cpufreq: ACPI: policy->driver_data can't be NULL in ->exit() X-Git-Tag: Ubuntu-5.2.0-15.16~9218^2~4^2~20^2~22^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9b55f55af8f017fec053c7eb0675241d057936da;p=mirror_ubuntu-eoan-kernel.git cpufreq: ACPI: policy->driver_data can't be NULL in ->exit() Its always set by ->init() and so it will always be there in ->exit(). There is no need to have a special check for just that. Signed-off-by: Viresh Kumar [ rjw: Rebase ] Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 67a612e22179..a24a0c05d7f8 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -878,14 +878,12 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) pr_debug("acpi_cpufreq_cpu_exit\n"); - if (data) { - policy->fast_switch_possible = false; - policy->driver_data = NULL; - acpi_processor_unregister_performance(data->acpi_perf_cpu); - free_cpumask_var(data->freqdomain_cpus); - kfree(data->freq_table); - kfree(data); - } + policy->fast_switch_possible = false; + policy->driver_data = NULL; + acpi_processor_unregister_performance(data->acpi_perf_cpu); + free_cpumask_var(data->freqdomain_cpus); + kfree(data->freq_table); + kfree(data); return 0; }