diff options
author | Li Jun <jun.li@nxp.com> | 2021-06-18 11:28:58 +0300 |
---|---|---|
committer | Peter Chen <peter.chen@kernel.org> | 2021-08-21 08:15:25 +0300 |
commit | e5d6a7c6cfae9e714a0e8ff64facd1ac68a784c6 (patch) | |
tree | d64fb0832cbc8798ba198927cf143850e38ad6ac /drivers/usb/chipidea/ci_hdrc_imx.c | |
parent | e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb (diff) | |
download | linux-e5d6a7c6cfae9e714a0e8ff64facd1ac68a784c6.tar.xz |
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 <zhipeng.wang_1@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1624004938-2399-1-git-send-email-jun.li@nxp.com
Signed-off-by: Peter Chen <peter.chen@kernel.org>
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.c')
0 files changed, 0 insertions, 0 deletions