diff options
author | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2015-02-12 05:09:47 +0000 |
---|---|---|
committer | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2015-02-12 05:09:47 +0000 |
commit | 53e376fb2720471ac3fb53248b8ec801c12deba2 (patch) | |
tree | c171a26ce14ee500ccfdd74017db7f98690ae5bf /sys/dev/usb/dwc2 | |
parent | 53f4d96846f5acf849208a56c9f9bcf8ab117f29 (diff) |
Don't panic even if parent port doesn't exist.
Diffstat (limited to 'sys/dev/usb/dwc2')
-rw-r--r-- | sys/dev/usb/dwc2/dwc2.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/dwc2/dwc2.c b/sys/dev/usb/dwc2/dwc2.c index 62aa1891a71..002b23ffbb1 100644 --- a/sys/dev/usb/dwc2/dwc2.c +++ b/sys/dev/usb/dwc2/dwc2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwc2.c,v 1.18 2015/02/11 22:55:25 uebayasi Exp $ */ +/* $OpenBSD: dwc2.c,v 1.19 2015/02/12 05:09:46 uebayasi Exp $ */ /* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */ /*- @@ -1677,8 +1677,10 @@ void dwc2_host_hub_info(struct dwc2_hsotg *hsotg, void *context, int *hub_addr, struct dwc2_pipe *dpipe = DWC2_XFER2DPIPE(xfer); struct usbd_device *dev = dpipe->pipe.device; - *hub_addr = dev->myhsport->parent->address; - *hub_port = dev->myhsport->portno; + if (dev->myhsport != NULL) { + *hub_addr = dev->myhsport->parent->address; + *hub_port = dev->myhsport->portno; + } } int dwc2_host_get_speed(struct dwc2_hsotg *hsotg, void *context) |