Skip to content

Commit b8a3cbc

Browse files
Yuan CanNipaLocal
Yuan Can
authored and
NipaLocal
committed
igb: Fix potential invalid memory access in igb_init_module()
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]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 7fe4707 commit b8a3cbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

+4
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,10 @@ static int __init igb_init_module(void)
637637
dca_register_notify(&dca_notifier);
638638
#endif
639639
ret = pci_register_driver(&igb_driver);
640+
#ifdef CONFIG_IGB_DCA
641+
if (ret)
642+
dca_unregister_notify(&dca_notifier);
643+
#endif
640644
return ret;
641645
}
642646

0 commit comments

Comments
 (0)