diff options
| author | WenTao Liang <vulab@iscas.ac.cn> | 2026-06-11 03:53:21 +0300 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-06-13 01:00:56 +0300 |
| commit | 4373cfa38ead58f980362c841b0d0bdf8c4d956c (patch) | |
| tree | 208df44904c637c9bd5b38f95e6dd71956c5717f /include/linux/workqueue.h | |
| parent | ba61aed9a34671222d1149acfc2f0179a9ce7e80 (diff) | |
| download | linux-4373cfa38ead58f980362c841b0d0bdf8c4d956c.tar.xz | |
power: supply: charger-manager: fix refcount leak in is_full_charged()
In is_full_charged(), power_supply_get_by_name() is called to
obtain a reference to the fuel_gauge power supply. If the
voltage check (uV >= desc->fullbatt_uV) succeeds, the function
returns true directly without releasing the reference, leaking
the refcount.
Fix this by setting a flag and jumping to the out label where
power_supply_put() properly drops the reference.
Cc: stable@vger.kernel.org
Fixes: e132fc6bb89b ("power: supply: charger-manager: Make decisions focussed on battery status")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260611005322.53096-1-vulab@iscas.ac.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux/workqueue.h')
0 files changed, 0 insertions, 0 deletions
