Re: [PATCH v2] power: supply: charger-manager: fix refcount leak in is_full_charged()
From: Sebastian Reichel
Date: Fri Jun 12 2026 - 18:05:37 EST
On Thu, 11 Jun 2026 08:53:21 +0800, WenTao Liang wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] power: supply: charger-manager: fix refcount leak in is_full_charged()
commit: 4373cfa38ead58f980362c841b0d0bdf8c4d956c
Best regards,
--
Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>