Avoid null reference, from Nick Hibma, FreeBSD.
This commit is contained in:
parent
46fd81350a
commit
60179e2a13
|
@ -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.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -466,12 +466,14 @@ uhub_disconnect_port(up)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hubname = USBDEVNAME(*up->parent->subdevs[0]);
|
if (dev->subdevs) {
|
||||||
for (i = 0; dev->subdevs[i]; i++) {
|
hubname = USBDEVNAME(*up->parent->subdevs[0]);
|
||||||
printf("%s: at %s port %d (addr %d) disconnected\n",
|
for (i = 0; dev->subdevs[i]; i++) {
|
||||||
USBDEVNAME(*dev->subdevs[i]), hubname,
|
printf("%s: at %s port %d (addr %d) disconnected\n",
|
||||||
up->portno, dev->address);
|
USBDEVNAME(*dev->subdevs[i]), hubname,
|
||||||
config_detach(dev->subdevs[i], DETACH_FORCE);
|
up->portno, dev->address);
|
||||||
|
config_detach(dev->subdevs[i], DETACH_FORCE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->bus->devices[dev->address] = 0;
|
dev->bus->devices[dev->address] = 0;
|
||||||
|
|
Loading…
Reference in New Issue