Re: [PATCH] power: supply: cros_peripheral_charger: unregister EC notifier

Sebastian Reichel <[email protected]> Mon, 20 Jul 2026 23:43:45 +0200
Newsgroups dev.linux.lists.chrome-platform,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm
Message-ID <[email protected]>
On Mon, 15 Jun 2026 14:31:05 +0800, Pengpeng Hou wrote:
> cros_pchg_probe() registers an EC event notifier whose callback uses the
> devm-allocated charger_data via container_of().  The driver has no
> remove callback and does not unregister the notifier, so the notifier
> chain can retain a pointer to freed driver state after unbind or probe
> cleanup.
> 
> Register a devm cleanup action immediately after the notifier is
> installed so the notifier is unregistered before the driver state is
> released.  Also fail probe if the notifier cannot be registered, instead
> of leaving a charger device that cannot receive EC events.
> 
> [...]

Applied, thanks!

[1/1] power: supply: cros_peripheral_charger: unregister EC notifier
      commit: c9386d5fabbe006c1f793b22bb80036303d1d166

Best regards,
-- 
Sebastian Reichel <[email protected]>