Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb prevent double free on error.



details:   https://anonhg.NetBSD.org/src/rev/a92dae3d5802
branches:  trunk
changeset: 783514:a92dae3d5802
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 27 01:11:13 2012 +0000

description:
prevent double free on error.

diffstat:

 sys/dev/usb/if_otus.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 9e5dbf5cbbab -r a92dae3d5802 sys/dev/usb/if_otus.c
--- a/sys/dev/usb/if_otus.c     Wed Dec 26 19:43:09 2012 +0000
+++ b/sys/dev/usb/if_otus.c     Thu Dec 27 01:11:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_otus.c,v 1.14 2012/12/09 02:59:16 christos Exp $    */
+/*     $NetBSD: if_otus.c,v 1.15 2012/12/27 01:11:13 christos Exp $    */
 /*     $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $        */
 
 /*-
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.14 2012/12/09 02:59:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.15 2012/12/27 01:11:13 christos Exp $");
 /*-
  * Driver for Atheros AR9001U chipset.
  * http://www.atheros.com/pt/bulletins/AR9001USBBulletin.pdf
@@ -1876,7 +1876,6 @@
        xferlen = sizeof(*head) + m->m_pkthdr.len;
        m_copydata(m, 0, m->m_pkthdr.len, (void *)&head[1]);
        m_freem(m);
-       ieee80211_free_node(ni);
 
        DPRINTFN(5, "tx queued=%d len=%d mac=0x%04x phy=0x%08x rate=%d\n",
            sc->sc_tx_queued, head->len, head->macctl, head->phyctl,
@@ -1887,6 +1886,7 @@
        if (__predict_false(error != USBD_IN_PROGRESS && error != 0))
                return error;
 
+       ieee80211_free_node(ni);
        sc->sc_tx_queued++;
        sc->sc_tx_cur = (sc->sc_tx_cur + 1) % OTUS_TX_DATA_LIST_COUNT;
 



Home | Main Index | Thread Index | Old Index