提交 dd21ca6d 编写于 作者: S Stanislaw Gruszka 提交者: David S. Miller

bnx2x: free workqueue when driver fail to register

Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
Acked-by: NEilon Greenstein <eilong@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a8679be2
......@@ -11630,13 +11630,20 @@ static struct pci_driver bnx2x_pci_driver = {
static int __init bnx2x_init(void)
{
int ret;
bnx2x_wq = create_singlethread_workqueue("bnx2x");
if (bnx2x_wq == NULL) {
printk(KERN_ERR PFX "Cannot create workqueue\n");
return -ENOMEM;
}
return pci_register_driver(&bnx2x_pci_driver);
ret = pci_register_driver(&bnx2x_pci_driver);
if (ret) {
printk(KERN_ERR PFX "Cannot register driver\n");
destroy_workqueue(bnx2x_wq);
}
return ret;
}
static void __exit bnx2x_cleanup(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册