1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

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 <uffe@uffe.org>
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2015-01-20 11:43:16 +00:00
parent 79b52c387e
commit 84e3f97e6d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=277417

View File

@ -1849,14 +1849,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 */