mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
23a00d8fb0
commit
2648e3d4ca
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user