power: supply: return -ENOMEM on OCV table alloc failure

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 <ivanrwcm25@gmail.com>
Link: https://patch.msgid.link/20260831155339.181487-2-ivanrwcm25@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Iván Ezequiel Rodriguez 2026-08-31 12:53:35 -03:00 committed by Sebastian Reichel
parent 23a00d8fb0
commit 2648e3d4ca

View File

@ -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);