提交 0cf3a14c 编写于 作者: A Amit Kumar Salecha 提交者: David S. Miller

qlcnic: fix netdev notifier in error path

netdev notifier are not unregistered if pci_register_driver fails.
Signed-off-by: NAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0df170b6
......@@ -3451,6 +3451,7 @@ static struct pci_driver qlcnic_driver = {
static int __init qlcnic_init_module(void)
{
int ret;
printk(KERN_INFO "%s\n", qlcnic_driver_string);
......@@ -3459,8 +3460,15 @@ static int __init qlcnic_init_module(void)
register_inetaddr_notifier(&qlcnic_inetaddr_cb);
#endif
ret = pci_register_driver(&qlcnic_driver);
if (ret) {
#ifdef CONFIG_INET
unregister_inetaddr_notifier(&qlcnic_inetaddr_cb);
unregister_netdevice_notifier(&qlcnic_netdev_cb);
#endif
}
return pci_register_driver(&qlcnic_driver);
return ret;
}
module_init(qlcnic_init_module);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册