aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasesh Mody <rmody@brocade.com>2011-09-21 20:55:41 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-21 20:55:41 -0400
commit3fc72370186be2f9d4d6ef06d99e1caa5d92c564 (patch)
tree94537707a3ed7c7f1ab1584cd11923ff20b49a1b
parentb7a17c0d846aab9f0e5d1dd3d005152c4ce459aa (diff)
bna: PCI Probe Conf Lock Fix
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>
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index abca1399fe51..db6c0978899b 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3359,6 +3359,7 @@ probe_success:
3359 return 0; 3359 return 0;
3360 3360
3361probe_uninit: 3361probe_uninit:
3362 mutex_lock(&bnad->conf_mutex);
3362 bnad_res_free(bnad, &bnad->mod_res_info[0], BNA_MOD_RES_T_MAX); 3363 bnad_res_free(bnad, &bnad->mod_res_info[0], BNA_MOD_RES_T_MAX);
3363disable_ioceth: 3364disable_ioceth:
3364 bnad_ioceth_disable(bnad); 3365 bnad_ioceth_disable(bnad);