diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-10-15 19:35:20 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-10-16 13:02:45 +0200 |
commit | 2d8b39a62a5d386a73f339e46fe05354a3a4895b (patch) | |
tree | 278bb10df8488575ff7e8fb9d52cd09ebeda2180 /drivers/hwmon/jc42.c | |
parent | cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown (diff) | |
download | linux-2d8b39a62a5d386a73f339e46fe05354a3a4895b.tar.xz linux-2d8b39a62a5d386a73f339e46fe05354a3a4895b.zip |
ACPI: processor: Avoid NULL pointer dereferences at init time
If there are neither processor objects nor processor device objects
in the ACPI tables, the per-CPU processors table will not be
initialized and attempting to dereference pointers from there will
cause the kernel to crash. This happens in acpi_processor_ppc_init()
and acpi_thermal_cpufreq_init() after commit d15ce412737a ("ACPI:
cpufreq: Switch to QoS requests instead of cpufreq notifier")
which didn't add the requisite NULL pointer checks in there.
Add the NULL pointer checks to acpi_processor_ppc_init() and
acpi_thermal_cpufreq_init(), and to the corresponding "exit"
routines.
While at it, drop redundant return instructions from
acpi_processor_ppc_init() and acpi_thermal_cpufreq_init().
Fixes: d15ce412737a ("ACPI: cpufreq: Switch to QoS requests instead of cpufreq notifier")
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/hwmon/jc42.c')
0 files changed, 0 insertions, 0 deletions