Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Avoid null reference, from Nick Hibma, FreeBSD.
details: https://anonhg.NetBSD.org/src/rev/fd70f0de6b96
branches: trunk
changeset: 475985:fd70f0de6b96
user: augustss <augustss%NetBSD.org@localhost>
date: Thu Sep 02 18:13:50 1999 +0000
description:
Avoid null reference, from Nick Hibma, FreeBSD.
diffstat:
sys/dev/usb/uhub.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (30 lines):
diff -r ff82dd4aaef5 -r fd70f0de6b96 sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c Thu Sep 02 18:11:41 1999 +0000
+++ b/sys/dev/usb/uhub.c Thu Sep 02 18:13:50 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhub.c,v 1.24 1999/08/28 21:42:35 augustss Exp $ */
+/* $NetBSD: uhub.c,v 1.25 1999/09/02 18:13:50 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -466,12 +466,14 @@
return;
}
- hubname = USBDEVNAME(*up->parent->subdevs[0]);
- for (i = 0; dev->subdevs[i]; i++) {
- printf("%s: at %s port %d (addr %d) disconnected\n",
- USBDEVNAME(*dev->subdevs[i]), hubname,
- up->portno, dev->address);
- config_detach(dev->subdevs[i], DETACH_FORCE);
+ if (dev->subdevs) {
+ hubname = USBDEVNAME(*up->parent->subdevs[0]);
+ for (i = 0; dev->subdevs[i]; i++) {
+ printf("%s: at %s port %d (addr %d) disconnected\n",
+ USBDEVNAME(*dev->subdevs[i]), hubname,
+ up->portno, dev->address);
+ config_detach(dev->subdevs[i], DETACH_FORCE);
+ }
}
dev->bus->devices[dev->address] = 0;
Home |
Main Index |
Thread Index |
Old Index