summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2005-04-16 08:27:42 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2005-04-16 08:27:42 +0000
commitf7cad60781c122d01e31e6afb523a8d93a20db2e (patch)
tree9a3bed3accf16c7e83e6ce9c0476da231381134c /sys
parent0243b0183833324821a86532aeead4c87a99dcae (diff)
don't leak a mbuf when tx fails.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_ral.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index cd0edea94b8..8534f743de0 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.26 2005/04/16 08:26:01 damien Exp $ */
+/* $OpenBSD: if_ral.c,v 1.27 2005/04/16 08:27:41 damien Exp $ */
/*-
* Copyright (c) 2005
@@ -1202,8 +1202,10 @@ ural_tx_mgt(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
USBD_FORCE_SHORT_XFER | USBD_NO_COPY, RAL_TX_TIMEOUT, ural_txeof);
error = usbd_transfer(data->xfer);
- if (error != USBD_NORMAL_COMPLETION && error != USBD_IN_PROGRESS)
+ if (error != USBD_NORMAL_COMPLETION && error != USBD_IN_PROGRESS) {
+ m_freem(m0);
return error;
+ }
sc->tx_queued++;
@@ -1289,8 +1291,10 @@ ural_tx_data(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
USBD_FORCE_SHORT_XFER | USBD_NO_COPY, RAL_TX_TIMEOUT, ural_txeof);
error = usbd_transfer(data->xfer);
- if (error != USBD_NORMAL_COMPLETION && error != USBD_IN_PROGRESS)
+ if (error != USBD_NORMAL_COMPLETION && error != USBD_IN_PROGRESS) {
+ m_freem(m0);
return error;
+ }
sc->tx_queued++;