Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a18cfd71 authored by Li Jun's avatar Li Jun Committed by Greg Kroah-Hartman
Browse files

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 85e3990b
("USB: EHCI: avoid undefined pointer arithmetic and placate UBSAN")

Reported-by: default avatarZhipeng Wang <zhipeng.wang_1@nxp.com>
Signed-off-by: default avatarLi Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1624004938-2399-1-git-send-email-jun.li@nxp.com


Signed-off-by: default avatarPeter Chen <peter.chen@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8deedce3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment