]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cpufreq: ACPI: policy->driver_data can't be NULL in ->exit()
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 7 Apr 2016 08:36:58 +0000 (14:06 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 8 Apr 2016 23:41:50 +0000 (01:41 +0200)
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 <viresh.kumar@linaro.org>
[ rjw: Rebase ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/acpi-cpufreq.c

index 67a612e2217985bcc71125912bf0c2f935cbd841..a24a0c05d7f83b1d0473c9ad6cab8bb4851be751 100644 (file)
@@ -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;
 }