Only one patch for improving port index calculation for chipidea driver, no big changes.
usb: chipidea: host: fix port index underflow and UBSAN complains

If wIndex is 0 (and it often is), these calculations underflow and
UBSAN complains, here resolve this by not decrementing the index when
it is equal to 0, this copies the solution from commit 85e3990bea49
("USB: EHCI: avoid undefined pointer arithmetic and placate UBSAN")

Reported-by: Zhipeng Wang <>
Signed-off-by: Li Jun <>
Signed-off-by: Peter Chen <>
1 file changed