diff mbox

[1/3] bnx2x: free workqueue when driver fail to register

Message ID 20090506112201.28609620@dhcp-lab-109.englab.brq.redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Stanislaw Gruszka May 6, 2009, 9:22 a.m. UTC
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/bnx2x_main.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Comments

Eilon Greenstein May 6, 2009, 12:04 p.m. UTC | #1
On Wed, 2009-05-06 at 02:22 -0700, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>

Thanks Stanislaw!



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller May 8, 2009, 9:52 p.m. UTC | #2
From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 6 May 2009 15:04:28 +0300

> On Wed, 2009-05-06 at 02:22 -0700, Stanislaw Gruszka wrote:
>> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Acked-by: Eilon Greenstein <eilong@broadcom.com>

Applied to net-next-2.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ad5ef25..ff2d9f6 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -11412,13 +11412,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)