Skip to content

Commit 1d0a619

Browse files
Dan Carpenterij-intel
authored andcommitted
platform/x86/intel: power-domains: Fix error code in tpmi_init()
Return -ENOMEM instead of success if kcalloc() fails. Fixes: e37be5d ("platform/x86/intel: power-domains: Add interface to get Linux die ID") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent afbdc4b commit 1d0a619

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/platform/x86/intel/tpmi_power_domains.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@ static int __init tpmi_init(void)
228228

229229
domain_die_map = kcalloc(size_mul(topology_max_packages(), MAX_POWER_DOMAINS),
230230
sizeof(*domain_die_map), GFP_KERNEL);
231-
if (!domain_die_map)
231+
if (!domain_die_map) {
232+
ret = -ENOMEM;
232233
goto free_domain_mask;
234+
}
233235

234236
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
235237
"platform/x86/tpmi_power_domains:online",

0 commit comments

Comments
 (0)