umber-kernel/drivers/phy/st
Dan Carpenter 7c27eaf183 phy: stm32-usphyc: Fix off by one in probe()
[ Upstream commit cabd25b57216ddc132efbcc31f972baa03aad15a ]

The "index" variable is used as an index into the usbphyc->phys[] array
which has usbphyc->nphys elements.  So if it is equal to usbphyc->nphys
then it is one element out of bounds.  The "index" comes from the
device tree so it's data that we trust and it's unlikely to be wrong,
however it's obviously still worth fixing the bug.  Change the > to >=.

Fixes: 94c358da3a ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://patch.msgid.link/aTfHcMJK1wFVnvEe@stanley.mountain
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-01-23 11:21:21 +01:00
..
Kconfig
Makefile
phy-miphy28lp.c
phy-spear1310-miphy.c
phy-spear1340-miphy.c
phy-stih407-usb.c phy: drop probe registration printks 2025-06-16 22:54:21 +05:30
phy-stm32-combophy.c phy: stm32: Fix constant-value overflow assertion 2025-02-10 22:26:07 +05:30
phy-stm32-usbphyc.c phy: stm32-usphyc: Fix off by one in probe() 2026-01-23 11:21:21 +01:00