Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb USB_DETACH(): Don't zero out sc->sc_pipe[i] afte...



details:   https://anonhg.NetBSD.org/src/rev/b07490b0651f
branches:  trunk
changeset: 572281:b07490b0651f
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Tue Dec 28 23:35:21 2004 +0000

description:
USB_DETACH(): Don't zero out sc->sc_pipe[i] after aborting the
pipe. This lets umass_disco() free the pipes and associated controller
state, rather than leaking 2-3 pipes per attach/detach cycle.

diffstat:

 sys/dev/usb/umass.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 9288965a9e47 -r b07490b0651f sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Tue Dec 28 22:30:07 2004 +0000
+++ b/sys/dev/usb/umass.c       Tue Dec 28 23:35:21 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $      */
+/*     $NetBSD: umass.c,v 1.117 2004/12/28 23:35:21 nathanw Exp $      */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -131,7 +131,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.117 2004/12/28 23:35:21 nathanw Exp $");
 
 #include "atapibus.h"
 #include "scsibus.h"
@@ -659,10 +659,8 @@
 
        /* Abort the pipes to wake up any waiting processes. */
        for (i = 0 ; i < UMASS_NEP ; i++) {
-               if (sc->sc_pipe[i] != NULL) {
+               if (sc->sc_pipe[i] != NULL)
                        usbd_abort_pipe(sc->sc_pipe[i]);
-                       sc->sc_pipe[i] = NULL;
-               }
        }
 
        /* Do we really need reference counting?  Perhaps in ioctl() */



Home | Main Index | Thread Index | Old Index