summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsemarie <semarie@openbsd.org>2015-08-12 08:04:20 +0000
committersemarie <semarie@openbsd.org>2015-08-12 08:04:20 +0000
commit66bc60c2fcb0bcbdc93e0534d16eb3a730a6d963 (patch)
treeb4e607854c2c6f20da2312ba760f2b02fca1eec2
parentAdd string/Ww as aliases for string/Bb, and ignore t. (The latest (diff)
downloadwireguard-openbsd-66bc60c2fcb0bcbdc93e0534d16eb3a730a6d963.tar.xz
wireguard-openbsd-66bc60c2fcb0bcbdc93e0534d16eb3a730a6d963.zip
removes two mem leaks in ti (in error path).
one leak reported by Maxime Villard initial patch from Christian Schulte (with spelling corrections in comments) second leak corrected by myself ok kettenis@
-rw-r--r--sys/dev/ic/ti.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/ti.c b/sys/dev/ic/ti.c
index f7d4147327c..788f1d72578 100644
--- a/sys/dev/ic/ti.c
+++ b/sys/dev/ic/ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ti.c,v 1.15 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: ti.c,v 1.16 2015/08/12 08:04:20 semarie Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -560,7 +560,7 @@ ti_handle_events(struct ti_softc *sc)
}
/*
- * Intialize a standard receive ring descriptor.
+ * Initialize a standard receive ring descriptor.
*/
int
ti_newbuf_std(struct ti_softc *sc, int i, struct mbuf *m,
@@ -620,7 +620,7 @@ ti_newbuf_std(struct ti_softc *sc, int i, struct mbuf *m,
}
/*
- * Intialize a mini receive ring descriptor. This only applies to
+ * Initialize a mini receive ring descriptor. This only applies to
* the Tigon 2.
*/
int
@@ -654,7 +654,7 @@ ti_newbuf_mini(struct ti_softc *sc, int i, struct mbuf *m,
if (bus_dmamap_load_mbuf(sc->sc_dmatag, dmamap, m_new,
BUS_DMA_NOWAIT)) {
- m_freem(m);
+ m_freem(m_new);
return (ENOBUFS);
}
} else {
@@ -712,7 +712,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int i, struct mbuf *m,
if (bus_dmamap_load_mbuf(sc->sc_dmatag, dmamap, m_new,
BUS_DMA_NOWAIT)) {
- m_freem(m);
+ m_freem(m_new);
return (ENOBUFS);
}
} else {