Thread (7 messages) flat view 7 messages, 4 authors, 7d ago

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

From: Jacob Keller <jacob.e.keller@intel.com>
Date: 2026-07-29 23:38:10
Also in: lkml

On 7/27/2026 8:20 PM, Can Peng wrote:
quoted hunk ↗ jump to hunk
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;
 }
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help