]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netconsole: Add automatic console unregistration on target removal
authorBreno Leitao <leitao@debian.org>
Mon, 9 Jun 2025 09:46:27 +0000 (02:46 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Jun 2025 21:21:53 +0000 (14:21 -0700)
commite99d938f867173937373b1bb08cbc2d102a07d0c
tree086caae56b98b6180914f451882776825050b0fc
parentbc0cb64db1c765a81f69997d5a28f539e1731bc0
netconsole: Add automatic console unregistration on target removal

Add unregister_netcons_consoles() function to automatically unregister
console handlers when no targets of the corresponding type remain active.

The function iterates through the target list to determine which console
types (basic vs extended) are still needed, and unregisters any console
handlers that are no longer required. This prevents having registered
console handlers without corresponding active targets.

The function is called when a target is disabled and moved to the cleanup
list, ensuring proper cleanup of unused console registrations.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250609-netcons_ext-v3-2-5336fa670326@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c