Commit 0566f83d authored by Yuan Can's avatar Yuan Can Committed by Tony Nguyen
Browse files

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: bbd98fe4 ("igb: Fix DCA errors and do not use context index for 82576")
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent f72ce14b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
}