summaryrefslogtreecommitdiffstats
path: root/sys/dev/sge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2011-10-17 19:49:00 +0000
committeryongari <yongari@FreeBSD.org>2011-10-17 19:49:00 +0000
commit4c371e596be040085df1b5f9e469ab9fd8278c89 (patch)
treed177532a5533584316ef20ec33ef25a4e8e17cac /sys/dev/sge
parent56e15a778cfacd77cc855073167c952c91381994 (diff)
downloadFreeBSD-src-4c371e596be040085df1b5f9e469ab9fd8278c89.zip
FreeBSD-src-4c371e596be040085df1b5f9e469ab9fd8278c89.tar.gz
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in mii_pollstat(), updating user supplied structure should be done before dropping a driver lock. Reported by: Karim (fodillemlinkarimi <> gmail dot com)
Diffstat (limited to 'sys/dev/sge')
-rw-r--r--sys/dev/sge/if_sge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/sge/if_sge.c b/sys/dev/sge/if_sge.c
index 03bf900..c56760d 100644
--- a/sys/dev/sge/if_sge.c
+++ b/sys/dev/sge/if_sge.c
@@ -1746,9 +1746,9 @@ sge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
return;
}
mii_pollstat(mii);
- SGE_UNLOCK(sc);
ifmr->ifm_active = mii->mii_media_active;
ifmr->ifm_status = mii->mii_media_status;
+ SGE_UNLOCK(sc);
}
static int
OpenPOWER on IntegriCloud