From: Rasesh Mody Date: Thu, 22 Sep 2011 00:55:41 +0000 (-0400) Subject: bna: PCI Probe Conf Lock Fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3fc72370186be2f9d4d6ef06d99e1caa5d92c564;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Rasesh Mody Signed-off-by: David S. Miller --- 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: 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);