Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Assign NULL to sc_pipe after closing, so that us...
details: https://anonhg.NetBSD.org/src/rev/2f66cea2c640
branches: trunk
changeset: 541090:2f66cea2c640
user: toshii <toshii%NetBSD.org@localhost>
date: Wed Jan 01 15:55:48 2003 +0000
description:
Assign NULL to sc_pipe after closing, so that usbd_close_pipe isn't
called twice. At least in NetBSD, the detach function is called when the
device is removed, even if the attach function has failed.
This is probably the cause of panics reported in kern/19326.
diffstat:
sys/dev/usb/umass.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r 552b7dc45640 -r 2f66cea2c640 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c Wed Jan 01 15:51:00 2003 +0000
+++ b/sys/dev/usb/umass.c Wed Jan 01 15:55:48 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass.c,v 1.92 2002/12/18 14:12:33 tron Exp $ */
+/* $NetBSD: umass.c,v 1.93 2003/01/01 15:55:48 toshii Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
* Nick Hibma <n_hibma%freebsd.org@localhost>
@@ -94,7 +94,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.92 2002/12/18 14:12:33 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.93 2003/01/01 15:55:48 toshii Exp $");
#include "atapibus.h"
#include "scsibus.h"
@@ -684,8 +684,10 @@
/* Remove all the pipes. */
for (i = 0 ; i < UMASS_NEP ; i++) {
- if (sc->sc_pipe[i] != NULL)
+ if (sc->sc_pipe[i] != NULL) {
usbd_close_pipe(sc->sc_pipe[i]);
+ sc->sc_pipe[i] = NULL;
+ }
}
}
Home |
Main Index |
Thread Index |
Old Index