From: Daniel Walker Date: Fri, 28 Mar 2008 21:41:27 +0000 (-0700) Subject: netdev: ehea: locking order correction X-Git-Tag: v2.6.26-rc1~1138^2~270^2~7 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=dbbcbb2d95dc4faa3b96d39f78032c85e8745c0c netdev: ehea: locking order correction 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 Cc: Christoph Raisch Cc: Jan-Bernd Themann Cc: Thomas Klein Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 4ae65e8..0cfc7e2 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c @@ -2567,14 +2567,14 @@ static int ehea_down(struct net_device *dev) 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();