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

From: Tzung-Bi Shih

Date: Tue Jul 28 2026 - 23:44:31 EST


On Tue, Jul 28, 2026 at 08:33:37PM +0800, Hongyan Xu wrote:
> Unregister the notifier before tearing down debugfs state. Also run the
> console-log cleanup in the probe error path.

Thanks for looking into this. This should separate into 2 patches: 1 for
cros_ec_cleanup_console_log() and 1 for blocking_notifier_chain_unregister().

> @@ -534,6 +534,7 @@ static int cros_ec_debugfs_probe(struct platform_device *pd)
> return 0;
>
> remove_debugfs:
> + cros_ec_cleanup_console_log(debug_info);

It can be called even if cros_ec_create_console_log() isn't called. It's
harmless because cros_ec_cleanup_console_log() checks
`debug_info->log_buffer.buf`.

To be clear, I'd prefer to introduce a new goto label for fixing it.