From ad0b32f9e90ddafc1a8eb1bc16b0e155afa0d7ca Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Sat, 30 Oct 2010 18:03:44 +0000 Subject: in otus, tx() can return on error without releasing the node so release the node in the caller (if_start) instead and do the same in run(4) for consistency. --- sys/dev/usb/if_run.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb/if_run.c') diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 258c591bf36..f23a5b6d724 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.79 2010/10/30 11:59:05 damien Exp $ */ +/* $OpenBSD: if_run.c,v 1.80 2010/10/30 18:03:43 damien Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini @@ -2191,7 +2191,6 @@ run_tx(struct run_softc *sc, struct mbuf *m, struct ieee80211_node *ni) m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)(txwi + 1)); m_freem(m); - ieee80211_release_node(ic, ni); xferlen += sizeof (*txd) + 4; @@ -2201,6 +2200,8 @@ run_tx(struct run_softc *sc, struct mbuf *m, struct ieee80211_node *ni) if (__predict_false(error != USBD_IN_PROGRESS && error != 0)) return error; + ieee80211_release_node(ic, ni); + ring->cur = (ring->cur + 1) % RUN_TX_RING_COUNT; if (++ring->queued >= RUN_TX_RING_COUNT) sc->qfullmsk |= 1 << qid; @@ -2249,6 +2250,7 @@ sendit: bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_OUT); #endif if (run_tx(sc, m, ni) != 0) { + ieee80211_release_node(ic, ni); ifp->if_oerrors++; continue; } -- cgit v1.2.3