summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2006-09-16 13:31:04 +0000
committerdamien <damien@openbsd.org>2006-09-16 13:31:04 +0000
commit708857ad4519a40b00d88635ace1ff7fc302f7a2 (patch)
treec34832a09a61f4e62d9c9be76c7a062559a91807
parentsync (uath) (diff)
downloadwireguard-openbsd-708857ad4519a40b00d88635ace1ff7fc302f7a2.tar.xz
wireguard-openbsd-708857ad4519a40b00d88635ace1ff7fc302f7a2.zip
fix a buggy printf.
in case something wrong happens in the Tx path, don't free a mbuf that is left in if_snd. ok deraadt@
-rw-r--r--sys/dev/usb/ueagle.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/usb/ueagle.c b/sys/dev/usb/ueagle.c
index c1762f60d17..2d4548b57b8 100644
--- a/sys/dev/usb/ueagle.c
+++ b/sys/dev/usb/ueagle.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: ueagle.c,v 1.11 2006/06/23 06:27:11 miod Exp $ */
+/* $OpenBSD: ueagle.c,v 1.12 2006/09/16 13:31:04 damien Exp $ */
/*-
- * Copyright (c) 2003-2005
+ * Copyright (c) 2003-2006
* Damien Bergamini <damien.bergamini@free.fr>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -18,7 +18,7 @@
*/
/*-
- * Analog Devices Eagle chipset driver
+ * Driver for Analog Devices Eagle chipset.
* http://www.analog.com/
*/
@@ -915,8 +915,8 @@ ueagle_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
}
#ifdef DIAGNOSTIC
if (count > 0) {
- printf("%s: truncated cell (%u bytes)\n", count,
- USBDEVNAME(sc->sc_dev));
+ printf("%s: truncated cell (%u bytes)\n",
+ USBDEVNAME(sc->sc_dev), count);
}
#endif
req->frlengths[i] = sc->isize;
@@ -1078,14 +1078,13 @@ ueagle_start(struct ifnet *ifp)
IFQ_POLL(&ifp->if_snd, m0);
if (m0 == NULL)
return;
+ IFQ_DEQUEUE(&ifp->if_snd, m0);
if (ueagle_encap(sc, m0) != 0) {
m_freem(m0);
return;
}
- IFQ_DEQUEUE(&ifp->if_snd, m0);
-
#if NBPFILTER > 0
if (ifp->if_bpf != NULL)
bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);