mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
igb: Fix potential invalid memory access in igb_init_module()
[ Upstream commit 0566f83d206c7a864abcd741fe39d6e0ae5eef29 ]
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: bbd98fe48a ("igb: Fix DCA errors and do not use context index for 82576")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
49b0aa1008
commit
8009cdcc49
@@ -665,6 +665,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user