From 4f6a96ae5be753744c3d9a0e1f0dc72e047bc300 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Wed, 16 Jan 2008 21:33:34 +0000 Subject: [PATCH] Fix lock ordering panic by not calling ether_ioctl with port lock held Reported by: rrs --- sys/dev/cxgb/cxgb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index e5057585a85e..581370bc5fa5 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1772,15 +1772,15 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) break; case SIOCSIFADDR: case SIOCGIFADDR: - PORT_LOCK(p); if (ifa->ifa_addr->sa_family == AF_INET) { + PORT_LOCK(p); ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) cxgb_init_locked(p); arp_ifinit(ifp, ifa); + PORT_UNLOCK(p); } else error = ether_ioctl(ifp, command, data); - PORT_UNLOCK(p); break; case SIOCSIFFLAGS: callout_drain(&p->adapter->cxgb_tick_ch);