bna: PCI Probe Conf Lock Fix
authorRasesh Mody <rmody@brocade.com>
Thu, 22 Sep 2011 00:55:41 +0000 (20:55 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Sep 2011 00:55:41 +0000 (20:55 -0400)
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>
drivers/net/ethernet/brocade/bna/bnad.c

index abca1399fe5104e611c171156f5451dc7569636b..db6c0978899b20db9401fa37a5219957296842fc 100644 (file)
@@ -3359,6 +3359,7 @@ probe_success:
        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);