linux/drivers/powercap
Zhang Rui 2d1f5006ff powercap: intel_rapl: Fix a NULL pointer dereference
A NULL pointer dereference is triggered when probing the MMIO RAPL
driver on platforms with CPU ID not listed in intel_rapl_common CPU
model list.

This is because the intel_rapl_common module still probes on such
platforms even if 'defaults_msr' is not set after commit 1488ac990a
("powercap: intel_rapl: Allow probing without CPUID match"). Thus the
MMIO RAPL rp->priv->defaults is NULL when registering to RAPL framework.

Fix the problem by adding sanity check to ensure rp->priv->rapl_defaults
is always valid.

Fixes: 1488ac990a ("powercap: intel_rapl: Allow probing without CPUID match")
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Cc: 6.5+ <stable@vger.kernel.org> # 6.5+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-02-13 17:31:48 +01:00
..
arm_scmi_powercap.c powercap: arm_scmi: Remove recursion while parsing zones 2023-07-20 20:27:10 +02:00
dtpm.c powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" 2022-03-01 18:59:35 +01:00
dtpm_cpu.c powercap: DTPM: Fix missing cpufreq_cpu_put() calls 2023-12-05 20:51:24 +01:00
dtpm_devfreq.c powercap: DTPM: Fix unneeded conversions to micro-Watts 2023-11-28 15:15:14 +01:00
dtpm_subsys.h powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
idle_inject.c Thermal control updates for 6.3-rc1 2023-02-21 12:32:05 -08:00
intel_rapl_common.c powercap: intel_rapl: Fix a NULL pointer dereference 2024-02-13 17:31:48 +01:00
intel_rapl_msr.c Perf events changes for v6.6: 2023-08-28 16:35:01 -07:00
intel_rapl_tpmi.c powercap: intel_rapl: Fix a sparse warning in TPMI interface 2023-08-01 13:45:08 +02:00
Kconfig powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-06-12 19:48:40 +02:00
Makefile powercap: intel_rapl: Introduce RAPL TPMI interface driver 2023-05-24 18:46:20 +02:00
powercap_sys.c powercap: remove MODULE_LICENSE in non-modules 2023-02-28 21:32:05 +01:00