LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Christoph Raisch <raisch@de.ibm.com>,
	Jan-Bernd Themann <themann@de.ibm.com>,
	Thomas Klein <tklein@de.ibm.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 3/5] net: ehea: locking order correction
Date: Thu, 06 Mar 2008 00:00:03 -0800	[thread overview]
Message-ID: <20080307032237.805326022@mvista.com> (raw)
In-Reply-To: <20080307032237.517704747@mvista.com>

[-- Attachment #1: net-ehea-correct-locking-order.patch --]
[-- Type: text/plain, Size: 920 bytes --]

Nested locks always need to be taken in the same order. This change
factors out the ehea_fw_handles.lock to make the locking order
consistent.

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/net/ehea/ehea_main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.24/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-2.6.24.orig/drivers/net/ehea/ehea_main.c
+++ linux-2.6.24/drivers/net/ehea/ehea_main.c
@@ -2567,14 +2567,14 @@ static int ehea_down(struct net_device *
 	if (port->state == EHEA_PORT_DOWN)
 		return 0;
 
+	mutex_lock(&ehea_fw_handles.lock);
+
 	down(&ehea_bcmc_regs.lock);
 	ehea_drop_multicast_list(dev);
 	ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
 
 	ehea_free_interrupts(dev);
 
-	mutex_lock(&ehea_fw_handles.lock);
-
 	port->state = EHEA_PORT_DOWN;
 
 	ehea_update_bcmc_registrations();

-- 

  parent reply	other threads:[~2008-03-07  3:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06  8:00 [PATCH 1/5] net: ehea: semaphore to mutex Daniel Walker
2008-03-06  8:00 ` [PATCH 2/5] net: ehea: ehea_fw_handles " Daniel Walker
2008-03-06  8:00 ` Daniel Walker [this message]
2008-03-06  8:00 ` [PATCH 4/5] net: ehea: bcmc_regs " Daniel Walker
2008-03-06  8:00 ` [PATCH 5/5] net: ehea: port_lock " Daniel Walker
2008-03-06  8:00 [PATCH 1/5] net: ehea: " Daniel Walker
2008-03-06  8:00 ` [PATCH 3/5] net: ehea: locking order correction Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080307032237.805326022@mvista.com \
    --to=dwalker@mvista.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raisch@de.ibm.com \
    --cc=themann@de.ibm.com \
    --cc=tklein@de.ibm.com \
    --subject='Re: [PATCH 3/5] net: ehea: locking order correction' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).