Author: hselasky
Date: Wed Jan 28 19:41:31 2015
New Revision: 277845
URL: https://svnweb.freebsd.org/changeset/base/277845

Log:
  MFC r277417:
  Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
  the value returned in the "udp_port_level" field.

Modified:
  stable/10/sys/dev/usb/usb_generic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/usb_generic.c
==============================================================================
--- stable/10/sys/dev/usb/usb_generic.c Wed Jan 28 18:45:40 2015        
(r277844)
+++ stable/10/sys/dev/usb/usb_generic.c Wed Jan 28 19:41:31 2015        
(r277845)
@@ -1850,14 +1850,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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to