diff options
author | Rasesh Mody <rmody@brocade.com> | 2011-08-30 19:27:38 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-15 23:36:33 +0400 |
commit | 0caa9aaec515268ec13b0939bfb7e32cf5a31a55 (patch) | |
tree | 13244d95a0e4773e8cf91fb342046d1854e6ebf8 /drivers/net | |
parent | 772b5235d86563b00786030d9f42af3a89fd0833 (diff) | |
download | linux-0caa9aaec515268ec13b0939bfb7e32cf5a31a55.tar.xz |
bna: PCI Probe Fix
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | 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 1f4269c4c9c5..939abd45c0a4 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -3253,8 +3253,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]); @@ -3266,6 +3268,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) { @@ -3274,6 +3278,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; |