summaryrefslogtreecommitdiffstats
path: root/sys/dev/en
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-03-25 09:39:02 +0000
committerru <ru@FreeBSD.org>2008-03-25 09:39:02 +0000
commit3b1bf8c2e9222b7d27e8b9084e637a84005de7ba (patch)
treecf0376c9359f2d1ca6e4e8e4ad4a4f722dba61a7 /sys/dev/en
parent0655a583e2ccba8b534e710284a730a0d6af1375 (diff)
downloadFreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.zip
FreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.tar.gz
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
Diffstat (limited to 'sys/dev/en')
-rw-r--r--sys/dev/en/midway.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 34ceff45..b937ca8 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -835,27 +835,15 @@ copy_mbuf(struct mbuf *m)
{
struct mbuf *new;
- MGET(new, M_TRYWAIT, MT_DATA);
- if (new == NULL)
- return (NULL);
+ MGET(new, M_WAIT, MT_DATA);
if (m->m_flags & M_PKTHDR) {
M_MOVE_PKTHDR(new, m);
- if (m->m_len > MHLEN) {
- MCLGET(new, M_TRYWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_free(new);
- return (NULL);
- }
- }
+ if (m->m_len > MHLEN)
+ MCLGET(new, M_WAIT);
} else {
- if (m->m_len > MLEN) {
- MCLGET(new, M_TRYWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_free(new);
- return (NULL);
- }
- }
+ if (m->m_len > MLEN)
+ MCLGET(new, M_WAIT);
}
bcopy(m->m_data, new->m_data, m->m_len);
@@ -2932,9 +2920,7 @@ en_attach(struct en_softc *sc)
&en_utopia_methods);
utopia_init_media(&sc->utopia);
- MGET(sc->padbuf, M_TRYWAIT, MT_DATA);
- if (sc->padbuf == NULL)
- goto fail;
+ MGET(sc->padbuf, M_WAIT, MT_DATA);
bzero(sc->padbuf->m_data, MLEN);
if (bus_dma_tag_create(NULL, 1, 0,
OpenPOWER on IntegriCloud