diff options
author | yongari <yongari@FreeBSD.org> | 2011-10-17 19:49:00 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-10-17 19:49:00 +0000 |
commit | 4c371e596be040085df1b5f9e469ab9fd8278c89 (patch) | |
tree | d177532a5533584316ef20ec33ef25a4e8e17cac /sys/dev/age/if_age.c | |
parent | 56e15a778cfacd77cc855073167c952c91381994 (diff) | |
download | FreeBSD-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/age/if_age.c')
-rw-r--r-- | sys/dev/age/if_age.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c index a1ab8c7..175dd97 100644 --- a/sys/dev/age/if_age.c +++ b/sys/dev/age/if_age.c @@ -282,9 +282,9 @@ age_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) mii = device_get_softc(sc->age_miibus); mii_pollstat(mii); - AGE_UNLOCK(sc); ifmr->ifm_status = mii->mii_media_status; ifmr->ifm_active = mii->mii_media_active; + AGE_UNLOCK(sc); } /* |