platform/x86/intel: power-domains: Fix error code in tpmi_init()
Return -ENOMEM instead of success if kcalloc() fails.
Fixes: e37be5d85c ("platform/x86/intel: power-domains: Add interface to get Linux die ID")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/aEKvIGCt6d8Gcx4S@stanley.mountain
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
committed by
Ilpo Järvinen
parent
afbdc4bbb3
commit
1d0a61940e
@@ -228,8 +228,10 @@ static int __init tpmi_init(void)
|
||||
|
||||
domain_die_map = kcalloc(size_mul(topology_max_packages(), MAX_POWER_DOMAINS),
|
||||
sizeof(*domain_die_map), GFP_KERNEL);
|
||||
if (!domain_die_map)
|
||||
if (!domain_die_map) {
|
||||
ret = -ENOMEM;
|
||||
goto free_domain_mask;
|
||||
}
|
||||
|
||||
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
|
||||
"platform/x86/tpmi_power_domains:online",
|
||||
|
||||
Reference in New Issue
Block a user