Thread (5 messages) read the whole thread 5 messages, 2 authors, 1d ago
WARM1d

[PATCH 2/2] qlcnic: move notifier error cleanup under CONFIG_INET

From: Can Peng <hidden>
Date: 2026-07-28 03:21:31
Also in: lkml
Subsystem: networking drivers, qlogic qlcnic (1/10)gb ethernet driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Shahed Shaikh, Manish Chopra, Linus Torvalds

qlcnic_init_module() registers the netdevice and inetaddr notifiers only
when CONFIG_INET is enabled, but the pci_register_driver() error handling
block is outside that guard.

Move the error check under CONFIG_INET together with the cleanup it
protects. This avoids an empty if statement when CONFIG_INET is disabled
and keeps the cleanup code structured like the guarded registration path.

Signed-off-by: Can Peng <redacted>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index ff4f7cd20c79..46d07faa24fd 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -4221,12 +4221,12 @@ static int __init qlcnic_init_module(void)
 #endif
 
 	ret = pci_register_driver(&qlcnic_driver);
-	if (ret) {
 #ifdef CONFIG_INET
+	if (ret) {
 		unregister_inetaddr_notifier(&qlcnic_inetaddr_cb);
 		unregister_netdevice_notifier(&qlcnic_netdev_cb);
-#endif
 	}
+#endif
 
 	return ret;
 }
-- 
2.53.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help