Re: [PATCH] platform/chrome: cros_ec_debugfs: unregister panic notifier on remove

From: Tzung-Bi Shih

Date: Tue Jun 16 2026 - 01:54:28 EST


On Mon, Jun 15, 2026 at 02:32:00PM +0800, Pengpeng Hou wrote:
> cros_ec_debugfs_probe() registers a panic notifier whose callback
> recovers struct cros_ec_debugfs with container_of() and can schedule or
> flush the console log work.
>
> cros_ec_debugfs_remove() removes debugfs state and cleans up the console
> log buffer, but it leaves the notifier registered. A later panic
> notification can therefore call back into freed debugfs state.
>
> Unregister the panic notifier before tearing down the debugfs and log
> state.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>

For my reference,
Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>