From: Rasesh Mody <rmody@brocade.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <adapter_linux_open_src_team@brocade.com>,
Rasesh Mody <rmody@brocade.com>,
Gurunatha Karaje <gkaraje@brocade.com>
Subject: [PATCH 02/14] bna: PCI Probe Fix
Date: Tue, 16 Aug 2011 14:19:39 -0700 [thread overview]
Message-ID: <1313529591-3718-3-git-send-email-rmody@brocade.com> (raw)
In-Reply-To: <1313529591-3718-1-git-send-email-rmody@brocade.com>
Change details:
- Return error as -EIO if bnad_res_alloc fails
- Release the configuration lock before registering with net_device layer.
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
drivers/net/ethernet/brocade/bna/bnad.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index bc5bfa7..8db7247 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3254,8 +3254,10 @@ bnad_pci_probe(struct pci_dev *pdev,
spin_unlock_irqrestore(&bnad->bna_lock, flags);
err = bnad_res_alloc(bnad, &bnad->mod_res_info[0], BNA_MOD_RES_T_MAX);
- if (err)
+ if (err) {
+ err = -EIO;
goto disable_ioceth;
+ }
spin_lock_irqsave(&bnad->bna_lock, flags);
bna_mod_init(&bnad->bna, &bnad->mod_res_info[0]);
@@ -3267,6 +3269,8 @@ bnad_pci_probe(struct pci_dev *pdev,
bnad_set_netdev_perm_addr(bnad);
spin_unlock_irqrestore(&bnad->bna_lock, flags);
+ mutex_unlock(&bnad->conf_mutex);
+
/* Finally, reguister with net_device layer */
err = register_netdev(netdev);
if (err) {
@@ -3275,6 +3279,8 @@ bnad_pci_probe(struct pci_dev *pdev,
}
set_bit(BNAD_RF_NETDEV_REGISTERED, &bnad->run_flags);
+ return 0;
+
probe_success:
mutex_unlock(&bnad->conf_mutex);
return 0;
--
1.7.1
next prev parent reply other threads:[~2011-08-16 21:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 21:19 [PATCH 00/14] bna: Update bna driver version to 3.0.2.1 Rasesh Mody
2011-08-16 21:19 ` [PATCH 01/14] bna: Naming Change and Minor Macro Fix Rasesh Mody
2011-08-16 21:19 ` Rasesh Mody [this message]
2011-08-16 21:19 ` [PATCH 03/14] bna: Interrupt Polling and NAPI Init Changes Rasesh Mody
2011-08-16 21:19 ` [PATCH 04/14] bna: Add Multiple Tx Queue Support Rasesh Mody
2011-08-16 21:48 ` Ben Hutchings
2011-08-16 23:32 ` Rasesh Mody
2011-08-16 23:43 ` Ben Hutchings
2011-08-17 0:17 ` John Fastabend
2011-08-17 2:14 ` Rasesh Mody
2011-08-17 5:47 ` John Fastabend
2011-08-17 21:24 ` Rasesh Mody
2011-08-16 21:19 ` [PATCH 05/14] bna: SKB Check and Drop Macros Rasesh Mody
2011-08-16 21:19 ` [PATCH 06/14] bna: TX Path and RX Path Changes Rasesh Mody
2011-08-16 21:45 ` Ben Hutchings
2011-08-16 23:28 ` Rasesh Mody
2011-08-16 21:19 ` [PATCH 07/14] bna: Formatting and Code Cleanup Rasesh Mody
2011-08-16 21:19 ` [PATCH 08/14] bna: Initialization and Locking Fix Rasesh Mody
2011-08-16 21:19 ` [PATCH 09/14] bna: Ethtool Enhancements and Fix Rasesh Mody
2011-08-16 21:43 ` Ben Hutchings
2011-08-16 23:26 ` Rasesh Mody
2011-08-16 21:19 ` [PATCH 10/14] bna: Async Mode Tx Rx Init Fix Rasesh Mody
2011-08-16 21:19 ` [PATCH 11/14] bna: MBOX IRQ Flag Check after Locking Rasesh Mody
2011-08-16 21:19 ` [PATCH 12/14] bna: Queue Depth and SKB Unmap Array Fix Rasesh Mody
2011-08-16 21:19 ` [PATCH 13/14] bna: SKB PCI UNMAP Fix Rasesh Mody
2011-08-16 21:19 ` [PATCH 14/14] bna: Driver Version changed to 3.0.2.1 Rasesh Mody
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313529591-3718-3-git-send-email-rmody@brocade.com \
--to=rmody@brocade.com \
--cc=adapter_linux_open_src_team@brocade.com \
--cc=davem@davemloft.net \
--cc=gkaraje@brocade.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).