nuttx/drivers/usbhost
Lwazi Dube 38ba0aefca usbhost_hub: Prevent crash when the last hub port is used.
An off-by-one error caused invalid memory to be accessed when the
last port was used. The first entry, at index 0, was never used.
The USB standard uses 1-based numbering for hub ports. This number
was used to index an array. This change converts the port number to
a zero-based port index when the array is accessed. The zero-based
value in the port field of the usbhost_hubport_s structure is also
converted before printing.

For testing, this bug was exposed on a 4 port hub when port 4 was
used after changing USBHUB_MAX_PORTS to 4 in hub.h. The bug should
also be triggered without changing hub.h if a 7 port hub is
available.
2023-05-12 11:41:26 +08:00
..
hid_parser.c Remove the unnecessary inclusion of assert.h and string.h from public header files 2021-12-20 10:30:08 +01:00
Kconfig usbhost_hidkbd: Add the option to use interrupt transfers. 2023-03-29 09:22:41 -03:00
Make.defs tools: replace INCDIR to Makefile variable 2022-11-03 19:59:55 +08:00
usbhost_cdcacm.c drivers/usbhost/usbhost_cdcacm.c: fix warning 2023-05-09 20:48:51 +08:00
usbhost_cdcmbim.c fs: Add g_ prefix for all global file_operations instances 2023-04-24 16:13:29 +02:00
usbhost_composite.c
usbhost_composite.h sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
usbhost_devaddr.c usbhost: Fix function address generation for multi-port root hubs. 2023-05-11 09:44:18 +02:00
usbhost_enumerate.c boards/sama5d3-xplained: Fix OHCI clock. 2023-03-21 14:08:03 -03:00
usbhost_findclass.c drivers: nxstyle fixes 2021-03-04 18:32:27 -08:00
usbhost_ft232r.c usb/ft232r: fixed build issue 2022-12-08 22:49:26 +08:00
usbhost_hidkbd.c usbhost_hidkbd: Add the option to use interrupt transfers. 2023-03-29 09:22:41 -03:00
usbhost_hidmouse.c fs: Move mmap callback before truncate in [file|mountpt]_operations 2023-01-04 17:43:59 +02:00
usbhost_hub.c usbhost_hub: Prevent crash when the last hub port is used. 2023-05-12 11:41:26 +08:00
usbhost_max3421e.c usbhost: Fix function address generation for multi-port root hubs. 2023-05-11 09:44:18 +02:00
usbhost_registerclass.c drivers: Author Gregory Nutt: update licenses to Apache 2021-03-04 18:32:27 -08:00
usbhost_registry.c drivers: Author Gregory Nutt: update licenses to Apache 2021-03-04 18:32:27 -08:00
usbhost_registry.h sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
usbhost_skeleton.c drivers/usbhost/usbhost_skeleton: fix typo 2022-11-03 14:43:12 +01:00
usbhost_storage.c fs: Add model field to geometry and mtd_geometry_s 2023-01-31 11:50:28 -03:00
usbhost_trace.c Don't include assert.h from public header file 2021-06-03 08:36:03 -07:00
usbhost_xboxcontroller.c fs: Move mmap callback before truncate in [file|mountpt]_operations 2023-01-04 17:43:59 +02:00