Files
erofs-linux/drivers/usb/host
Mathias Nyman ae4ff9dead xhci: Fix NULL pointer dereference when reading portli debugfs files
Michal reported and debgged a NULL pointer dereference bug in the
recently added portli debugfs files

Oops is caused when there are more port registers counted in
xhci->max_ports than ports reported by Supported Protocol capabilities.
This is possible if max_ports is more than maximum port number, or
if there are gaps between ports of different speeds the 'Supported
Protocol' capabilities.

In such cases port->rhub will be NULL so we can't reach xhci behind it.
Add an explicit NULL check for this case, and print portli in hex
without dereferencing port->rhub.

Reported-by: Michal Pecio <[email protected]>
Closes: https://lore.kernel.org/linux-usb/[email protected]
Fixes: 384c57ec72 ("usb: xhci: Add debugfs support for xHCI Port Link Info (PORTLI) register.")
Cc: [email protected]
Signed-off-by: Mathias Nyman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2026-03-11 16:18:48 +01:00
..
2024-11-04 01:27:52 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
2025-10-28 15:35:15 +01:00