Skip to content

Commit

Permalink
igb: Fix potential invalid memory access in igb_init_module()
Browse files Browse the repository at this point in the history
The pci_register_driver() can fail and when this happened, the dca_notifier
needs to be unregistered, otherwise the dca_notifier can be called when
igb fails to install, resulting to invalid memory access.

Fixes: bbd98fe ("igb: Fix DCA errors and do not use context index for 82576")
Signed-off-by: Yuan Can <[email protected]>
Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <[email protected]>
  • Loading branch information
Yuan Can authored and anguy11 committed Dec 3, 2024
1 parent f72ce14 commit 0566f83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/intel/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ static int __init igb_init_module(void)
dca_register_notify(&dca_notifier);
#endif
ret = pci_register_driver(&igb_driver);
#ifdef CONFIG_IGB_DCA
if (ret)
dca_unregister_notify(&dca_notifier);
#endif
return ret;
}

Expand Down

0 comments on commit 0566f83

Please sign in to comment.