From 2648e3d4ca08014eb6125d96acb177e767d7c807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ezequiel=20Rodriguez?= Date: Mon, 31 Aug 2026 12:53:35 -0300 Subject: [PATCH] power: supply: return -ENOMEM on OCV table alloc failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit power_supply_get_battery_info() maps a failed kcalloc() for the OCV capacity table to -EINVAL. Return -ENOMEM instead, matching the resistance-temp-table allocation path in the same function. Signed-off-by: Iván Ezequiel Rodriguez Link: https://patch.msgid.link/20260831155339.181487-2-ivanrwcm25@gmail.com Signed-off-by: Sebastian Reichel --- drivers/power/supply/power_supply_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index c097601ac549..15dcbae82b3d 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -907,7 +907,7 @@ int power_supply_get_battery_info(struct power_supply *psy, u32 *propdata __free(kfree) = kcalloc(proplen, sizeof(*propdata), GFP_KERNEL); if (!propdata) { power_supply_put_battery_info(psy, info); - err = -EINVAL; + err = -ENOMEM; goto out_put_node; } err = fwnode_property_read_u32_array(fwnode, propname, propdata, proplen);