Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb correct previous. assign the sc, and move the de...



details:   https://anonhg.NetBSD.org/src/rev/3b61abba3abf
branches:  trunk
changeset: 784487:3b61abba3abf
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 29 19:27:36 2013 +0000

description:
correct previous. assign the sc, and move the destroy later where it is safe

diffstat:

 sys/dev/usb/uhci.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 1873e682daf8 -r 3b61abba3abf sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Tue Jan 29 19:23:09 2013 +0000
+++ b/sys/dev/usb/uhci.c        Tue Jan 29 19:27:36 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.253 2013/01/29 00:00:15 christos Exp $      */
+/*     $NetBSD: uhci.c,v 1.254 2013/01/29 19:27:36 christos Exp $      */
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.253 2013/01/29 00:00:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.254 2013/01/29 19:27:36 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -578,8 +578,6 @@
        if (rv != 0)
                return (rv);
 
-       pool_cache_destroy(sc->sc_xferpool);
-
        callout_halt(&sc->sc_poll_handle, NULL);
        callout_destroy(&sc->sc_poll_handle);
 
@@ -588,6 +586,8 @@
        mutex_destroy(&sc->sc_lock);
        mutex_destroy(&sc->sc_intr_lock);
 
+       pool_cache_destroy(sc->sc_xferpool);
+
        /* XXX free other data structures XXX */
 
        return (rv);
@@ -650,6 +650,7 @@
        xfer = pool_cache_get(sc->sc_xferpool, PR_NOWAIT);
        if (xfer != NULL) {
                memset(xfer, 0, sizeof(struct uhci_xfer));
+               UXFER(xfer)->iinfo.sc = sc;
 #ifdef DIAGNOSTIC
                UXFER(xfer)->iinfo.isdone = 1;
                xfer->busy_free = XFER_BUSY;



Home | Main Index | Thread Index | Old Index