kernel_optimize_test/drivers/usb/chipidea
Li Jun 2d3fab9cea usb: chipidea: host: fix port index underflow and UBSAN complains
[ Upstream commit e5d6a7c6cfae9e714a0e8ff64facd1ac68a784c6 ]

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 85e3990bea
("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-18 13:40:30 +02:00
..
bits.h
ci_hdrc_imx.c
ci_hdrc_imx.h
ci_hdrc_msm.c
ci_hdrc_pci.c
ci_hdrc_tegra.c
ci_hdrc_usb2.c
ci.h
core.c
debug.c
host.c usb: chipidea: host: fix port index underflow and UBSAN complains 2021-09-18 13:40:30 +02:00
host.h
Kconfig
Makefile
otg_fsm.c
otg_fsm.h
otg.c
otg.h
udc.c
udc.h
ulpi.c
usbmisc_imx.c