Skip to content

Commit

Permalink
bna: PCI Probe Conf Lock Fix
Browse files Browse the repository at this point in the history
If register_netdev() fails now, then we call mutex_unlock(&bnad->conf_mutex);
on the error path, but it's already unlocked. So we acquire the lock in error
path which will be later unlocked after the cleanup.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rasesh Mody authored and David S. Miller committed Sep 22, 2011
1 parent b7a17c0 commit 3fc7237
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/brocade/bna/bnad.c
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,7 @@ bnad_pci_probe(struct pci_dev *pdev,
return 0;

probe_uninit:
mutex_lock(&bnad->conf_mutex);
bnad_res_free(bnad, &bnad->mod_res_info[0], BNA_MOD_RES_T_MAX);
disable_ioceth:
bnad_ioceth_disable(bnad);
Expand Down

0 comments on commit 3fc7237

Please sign in to comment.