summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-03-11 04:56:30 +0000
committerthompsa <thompsa@FreeBSD.org>2009-03-11 04:56:30 +0000
commit02a143df1f2dd43c85a9ce0e383bf785aafebe64 (patch)
treec202c7a8abf6de846fcf74f1daff9ada3e117eac /sys/dev/usb
parent95651d9cb685937ac5e7b95e62a5cb874fff4a0f (diff)
downloadFreeBSD-src-02a143df1f2dd43c85a9ce0e383bf785aafebe64.zip
FreeBSD-src-02a143df1f2dd43c85a9ce0e383bf785aafebe64.tar.gz
Fix a possible NULL pointer access at controller attach.
Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/controller/usb_controller.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index b91be6c..f835ec1 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -346,7 +346,8 @@ usb2_bus_attach(struct usb2_proc_msg *pm)
err = usb2_probe_and_attach(child,
USB_IFACE_INDEX_ANY);
if (!err) {
- if (!bus->devices[USB_ROOT_HUB_ADDR]->hub) {
+ if ((bus->devices[USB_ROOT_HUB_ADDR] == NULL) ||
+ (bus->devices[USB_ROOT_HUB_ADDR]->hub == NULL)) {
err = USB_ERR_NO_ROOT_HUB;
}
}
OpenPOWER on IntegriCloud