Skip to content

Commit

Permalink
ixgbe: fix registration order of driver and DCA nofitication
Browse files Browse the repository at this point in the history
ixgbe_notify_dca cannot be called before driver registration
because it expects driver's klist_devices to be allocated and
initialized. While on it make sure debugfs files are removed
when registration fails.

Cc: stable <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Tested-by: Phil Schmitt <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jakub Kicinski authored and davem330 committed Apr 5, 2013
1 parent 0e82e7f commit f01fc1a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7922,12 +7922,19 @@ static int __init ixgbe_init_module(void)
ixgbe_dbg_init();
#endif /* CONFIG_DEBUG_FS */

ret = pci_register_driver(&ixgbe_driver);
if (ret) {
#ifdef CONFIG_DEBUG_FS
ixgbe_dbg_exit();
#endif /* CONFIG_DEBUG_FS */
return ret;
}

#ifdef CONFIG_IXGBE_DCA
dca_register_notify(&dca_notifier);
#endif

ret = pci_register_driver(&ixgbe_driver);
return ret;
return 0;
}

module_init(ixgbe_init_module);
Expand Down

0 comments on commit f01fc1a

Please sign in to comment.