Skip to content

Commit 6aa1c3a

Browse files
Hans de Goedesre
authored andcommitted
power: supply: bq24190: Free battery_info
Call power_supply_put_battery_info() when bq24190_get_config() is done with it. The "struct power_supply_battery_info *info" pointer runs out of scope at the end of bq24190_get_config() so there is no need to keep it around after this. Note technically this is not a memleak fix, since all battery_info data is devm_alloc()-ed so it would still be free-ed when the driver is unbound. This just frees it as soon as the driver is done with it. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 2986e5b commit 6aa1c3a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/power/supply/bq24190_charger.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,8 @@ static int bq24190_get_config(struct bq24190_dev_info *bdi)
19831983
v = info->constant_charge_voltage_max_uv;
19841984
if (v >= bq24190_cvc_vreg_values[0] && v <= bdi->vreg_max)
19851985
bdi->vreg = bdi->vreg_max = v;
1986+
1987+
power_supply_put_battery_info(bdi->charger, info);
19861988
}
19871989

19881990
return 0;

0 commit comments

Comments
 (0)