diff options
author | Tony Lindgren <tony@atomide.com> | 2021-01-10 21:53:50 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2021-01-14 23:42:37 +0100 |
commit | 97456a24acb41b74ab6910f40fb8f09b206fd3b5 (patch) | |
tree | 65949032a80dae22d52d754ff04b6e6ca80aafbb /drivers/power | |
parent | 4bff91bb3231882b530af794c92ac3a5fe199481 (diff) | |
download | linux-97456a24acb41b74ab6910f40fb8f09b206fd3b5.tar.bz2 |
power: supply: cpcap-battery: Fix missing power_supply_put()
Fix missing power_supply_put().
Cc: Arthur Demchenkov <spinal.by@gmail.com>
Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Fixes: 8b0134cc14b9 ("power: supply: cpcap-battery: Fix handling of lowered charger voltage")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/supply/cpcap-battery.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c index 00c2d0136175..283f7e0c1d54 100644 --- a/drivers/power/supply/cpcap-battery.c +++ b/drivers/power/supply/cpcap-battery.c @@ -568,17 +568,21 @@ static int cpcap_battery_update_charger(struct cpcap_battery_ddata *ddata, POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, &prop); if (error) - return error; + goto out_put; /* Allow charger const voltage lower than battery const voltage */ if (const_charge_voltage > prop.intval) - return 0; + goto out_put; val.intval = const_charge_voltage; - return power_supply_set_property(charger, + error = power_supply_set_property(charger, POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, &val); +out_put: + power_supply_put(charger); + + return error; } static int cpcap_battery_set_property(struct power_supply *psy, |