[net-next 1/1] bna: PCI Probe Conf Lock Fix

Subsystems: brocade bna 10 gigabit ethernet driver, networking drivers, the rest

3 messages, 2 authors, 2011-09-22 · open the first message on its own page

[net-next 1/1] bna: PCI Probe Conf Lock Fix

From: Rasesh Mody <hidden>
Date: 2011-09-22 00:32:09

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.

Signed-off-by: Rasesh Mody <redacted>
---
 drivers/net/ethernet/brocade/bna/bnad.c |    1 +
 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 abca139..db6c097 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);
-- 
1.7.1

Re: [net-next 1/1] bna: PCI Probe Conf Lock Fix

From: David Miller <davem@davemloft.net>
Date: 2011-09-22 00:43:05

From: Rasesh Mody <redacted>
Date: Wed, 21 Sep 2011 17:31:50 -0700
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.

Signed-off-by: Rasesh Mody <redacted>
Applied, but I had to add:

Reported-by: Dan Carpenter <redacted>

Please don't leave out bug reporter credit like this.

RE: [net-next 1/1] bna: PCI Probe Conf Lock Fix

From: Rasesh Mody <hidden>
Date: 2011-09-22 00:54:31

From: David Miller [mailto:davem@davemloft.net]
Sent: Wednesday, September 21, 2011 5:42 PM

Applied, but I had to add:

Reported-by: Dan Carpenter <redacted>

Please don't leave out bug reporter credit like this.
Thanks for doing it this time, we'll take care of adding the bug reporter in future.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help