Author: hselasky Date: Tue Jan 20 11:43:16 2015 New Revision: 277417 URL: https://svnweb.freebsd.org/changeset/base/277417
Log: Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular the value returned in the "udp_port_level" field. Reported by: Uffe Jakobsen <[email protected]> MFC after: 1 week Modified: head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Tue Jan 20 11:32:48 2015 (r277416) +++ head/sys/dev/usb/usb_generic.c Tue Jan 20 11:43:16 2015 (r277417) @@ -1849,14 +1849,13 @@ ugen_get_port_path(struct usb_fifo *f, s 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 */ _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "[email protected]"
