From patchwork Wed May 6 09:22:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 26900 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 79C30B6F35 for ; Wed, 6 May 2009 19:28:23 +1000 (EST) Received: by ozlabs.org (Postfix) id 5E875DDDF3; Wed, 6 May 2009 19:28:23 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 02C6CDDDF0 for ; Wed, 6 May 2009 19:28:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753577AbZEFJ2Q (ORCPT ); Wed, 6 May 2009 05:28:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752981AbZEFJ2Q (ORCPT ); Wed, 6 May 2009 05:28:16 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35053 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbZEFJ2Q (ORCPT ); Wed, 6 May 2009 05:28:16 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n469SGL3021703; Wed, 6 May 2009 05:28:16 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n469SGQE030884; Wed, 6 May 2009 05:28:16 -0400 Received: from dhcp-lab-109.englab.brq.redhat.com (dhcp-lab-109.englab.brq.redhat.com [10.34.33.109]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n469SEjT004196; Wed, 6 May 2009 05:28:15 -0400 Date: Wed, 6 May 2009 11:22:01 +0200 From: Stanislaw Gruszka To: "netdev@vger.kernel.org" Cc: Eilon Greenstein Subject: [PATCH 1/3] bnx2x: free workqueue when driver fail to register Message-ID: <20090506112201.28609620@dhcp-lab-109.englab.brq.redhat.com> Organization: RedHat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Stanislaw Gruszka Acked-by: Eilon Greenstein --- drivers/net/bnx2x_main.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) 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)