# Re: \[PATCH printk v3 32/40\] netconsole: avoid CON\_ENABLED misuse to track registration

- From: Petr Mladek \<pmladek@suse.com\>
- Date: 2022-11-10 15:17:51 
- List: netdev
- Page: https://ratatoskr.run/netdev/2022/11/2000898
- Thread: https://ratatoskr.run/netdev/2022/11/238342/t.md

```text
On Mon 2022-11-07 15:22:30, John Ogness wrote:
> The CON_ENABLED flag is being misused to track whether or not the
> extended console should be or has been registered. Instead use
> a local variable to decide if the extended console should be
> registered and console_is_registered() to determine if it has
> been registered.
> 
> Also add a check in cleanup_netconsole() to only unregister the
> extended console if it has been registered.
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr
```
