summaryrefslogtreecommitdiffstats
path: root/sys/dev/en
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-12-17 10:01:46 +0000
committerharti <harti@FreeBSD.org>2003-12-17 10:01:46 +0000
commit1745a6f617198f9102f166b0f12d436618efbdec (patch)
tree8dd361bbf7242e2ddb89ac7f1358d4a5a3535988 /sys/dev/en
parentc311c8158e3fbfb0f6ca17f4cf8d29f42ff8467c (diff)
downloadFreeBSD-src-1745a6f617198f9102f166b0f12d436618efbdec.zip
FreeBSD-src-1745a6f617198f9102f166b0f12d436618efbdec.tar.gz
Move the locking of the softc up to before the allocation of the
transmission map. This allocation accesses the softc so should be under the lock (it uses NOWAIT).
Diffstat (limited to 'sys/dev/en')
-rw-r--r--sys/dev/en/midway.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 48df206..494a61e 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -1028,6 +1028,11 @@ en_start(struct ifnet *ifp)
(int)M_TRAILINGSPACE(lastm)));
/*
+ * From here on we need access to sc
+ */
+ EN_LOCK(sc);
+
+ /*
* Allocate a map. We do this here rather then in en_txdma,
* because en_txdma is also called from the interrupt handler
* and we are going to have a locking problem then. We must
@@ -1040,14 +1045,11 @@ en_start(struct ifnet *ifp)
EN_COUNT(sc->stats.txnomap);
if (map != NULL)
uma_zfree(sc->map_zone, map);
+ EN_UNLOCK(sc);
m_freem(m);
continue;
}
- /*
- * From here on we need access to sc
- */
- EN_LOCK(sc);
if ((ifp->if_flags & IFF_RUNNING) == 0) {
EN_UNLOCK(sc);
uma_zfree(sc->map_zone, map);
OpenPOWER on IntegriCloud