summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-01-28 19:41:31 +0000
committerhselasky <hselasky@FreeBSD.org>2015-01-28 19:41:31 +0000
commit8f49a6a1cbf222f4718aa15691834c23f73819a2 (patch)
treec78fa1495dc5cc116bb5ff5104559049ef6bb8b8 /sys/dev/usb
parentbad15605e4ea23b91de9e414acefb14de141a71e (diff)
downloadFreeBSD-src-8f49a6a1cbf222f4718aa15691834c23f73819a2.zip
FreeBSD-src-8f49a6a1cbf222f4718aa15691834c23f73819a2.tar.gz
MFC r277417:
Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular the value returned in the "udp_port_level" field.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usb_generic.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c
index 4ebd557..b12ae0e 100644
--- a/sys/dev/usb/usb_generic.c
+++ b/sys/dev/usb/usb_generic.c
@@ -1850,14 +1850,13 @@ ugen_get_port_path(struct usb_fifo *f, struct usb_device_port_path *dpp)
if (nlevel > USB_DEVICE_PORT_PATH_MAX)
goto error;
+ /* store total level of ports */
+ dpp->udp_port_level = nlevel;
+
/* store port index array */
next = udev;
while (next->parent_hub != NULL) {
- nlevel--;
-
- dpp->udp_port_no[nlevel] = next->port_no;
- dpp->udp_port_level = nlevel;
-
+ dpp->udp_port_no[--nlevel] = next->port_no;
next = next->parent_hub;
}
return (0); /* success */
OpenPOWER on IntegriCloud