android_kernel_motorola_sm6225/drivers/phy
Harshit Mogalapalli 2843a2e703 phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe()
[ Upstream commit 13c088cf3657d70893d75cf116be937f1509cc0f ]

The size of array 'priv->ports[]' is INNO_PHY_PORT_NUM.

In the for loop, 'i' is used as the index for array 'priv->ports[]'
with a check (i > INNO_PHY_PORT_NUM) which indicates that
INNO_PHY_PORT_NUM is allowed value for 'i' in the same loop.

This > comparison needs to be changed to >=, otherwise it potentially leads
to an out of bounds write on the next iteration through the loop

Fixes: ba8b0ee81f ("phy: add inno-usb2-phy driver for hi3798cv200 SoC")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230721090558.3588613-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-11 11:45:30 +02:00
..
allwinner phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked 2020-07-22 09:32:05 +02:00
amlogic
broadcom
hisilicon phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-08-11 11:45:30 +02:00
lantiq
marvell phy: marvell: ARMADA375_USBCLUSTER_PHY should not default to y, unconditionally 2021-05-22 10:59:29 +02:00
mediatek
motorola phy: cpcap-usb: Fix warning for missing regulator_disable 2021-02-07 14:48:37 +01:00
qualcomm phy: qualcomm: call clk_disable_unprepare in the error handling 2022-10-26 13:19:33 +02:00
ralink
renesas
rockchip phy: rockchip-typec: Fix unsigned comparison with less than zero 2023-03-11 16:32:01 +01:00
samsung phy: samsung: exynos5250-sata: fix missing device put in probe error paths 2022-05-12 12:20:20 +02:00
st phy: st: miphy28lp: use _poll_timeout functions for waits 2023-05-30 12:42:10 +01:00
tegra phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port 2023-05-17 11:13:20 +02:00
ti phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe() 2021-07-20 16:15:57 +02:00
Kconfig
Makefile
phy-core.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c