diff options
author | yongari <yongari@FreeBSD.org> | 2006-07-20 04:01:54 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2006-07-20 04:01:54 +0000 |
commit | 4865b8aa7c5208ebfd5e38819bfdd039fb24b56b (patch) | |
tree | c33ec7347b64cde6c77877847508a4e4811da46d /sys/dev | |
parent | fd96b482f1f143fae76f3e8ff5ad1091fc4c0fe7 (diff) | |
download | FreeBSD-src-4865b8aa7c5208ebfd5e38819bfdd039fb24b56b.zip FreeBSD-src-4865b8aa7c5208ebfd5e38819bfdd039fb24b56b.tar.gz |
Protect EEPROM access with the driver lock.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/em/if_em.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index a0d0dfb..e6bc244 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -766,6 +766,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); + EM_LOCK(sc); switch (sc->hw.mac_type) { case em_82573: /* @@ -789,11 +790,11 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } if (ifr->ifr_mtu > max_frame_size - ETHER_HDR_LEN - ETHER_CRC_LEN) { + EM_UNLOCK(sc); error = EINVAL; break; } - EM_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; sc->hw.max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; |