summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_sis.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-08-09 11:40:56 +0000
committerderaadt <deraadt@openbsd.org>2009-08-09 11:40:56 +0000
commit415ac77a3a2772736744faf2d84ece851590666b (patch)
tree059f756f4314ab891c239f074b6c70dd4668a948 /sys/dev/pci/if_sis.c
parentInitialize all the InputFieldData members correctly. Fixes a crash when (diff)
downloadwireguard-openbsd-415ac77a3a2772736744faf2d84ece851590666b.tar.xz
wireguard-openbsd-415ac77a3a2772736744faf2d84ece851590666b.zip
MCLGETI() will now allocate a mbuf header if it is not provided, thus
reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
Diffstat (limited to 'sys/dev/pci/if_sis.c')
-rw-r--r--sys/dev/pci/if_sis.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index bc8a6d9cfa6..3fb8be5af3b 100644
--- a/sys/dev/pci/if_sis.c
+++ b/sys/dev/pci/if_sis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.94 2009/07/22 21:32:50 miod Exp $ */
+/* $OpenBSD: if_sis.c,v 1.95 2009/08/09 11:40:56 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1232,16 +1232,10 @@ sis_newbuf(struct sis_softc *sc, struct sis_desc *c)
if (c == NULL)
return (EINVAL);
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL)
+ m_new = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES);
+ if (!m_new)
return (ENOBUFS);
- MCLGETI(m_new, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES);
- if (!(m_new->m_flags & M_EXT)) {
- m_free(m_new);
- return (ENOBUFS);
- }
-
m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
if (bus_dmamap_load_mbuf(sc->sc_dmat, c->map, m_new,