[PATCH 0/2] platform/x86/intel: power-domains: Handle failed tpmi_init()
From: Kristen Carlson Accardi
Date: Thu Sep 24 2026 - 15:34:18 EST
tpmi_init() can fail before domain_die_map and tpmi_power_domain_mask
are usable. It returns -ENODEV on CPU models that are not in
tpmi_cpu_ids, before allocating them, and if cpuhp_setup_state() fails
it frees them but leaves the pointers set. When the driver is built in,
its exported helpers stay callable after either failure.
Patch 1 fixes tpmi_get_linux_die_id(), which dereferences the NULL map.
uncore-frequency-tpmi calls it when the world-readable die_id sysfs
attribute is read, so on a multi-die CPU missing from tpmi_cpu_ids that
read oopses.
Patch 2 adds the same guard to tpmi_get_power_domain_mask(). It has no
callers in the tree, so this is hardening and carries no Fixes tag.
Both build cleanly with W=1, built in and as a module. Neither has been
runtime-tested on an affected system.
Kristen Carlson Accardi (2):
platform/x86/intel: power-domains: Handle failed init in
tpmi_get_linux_die_id()
platform/x86/intel: power-domains: Handle failed init in
tpmi_get_power_domain_mask()
.../platform/x86/intel/tpmi_power_domains.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--
2.55.0