linux-yocto/drivers/phy
Chenyuan Yang 0b979a409e phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug
[ Upstream commit d14402a38c ]

The qmp_usb_iomap() helper function currently returns the raw result of
devm_ioremap() for non-exclusive mappings. Since devm_ioremap() may return
a NULL pointer and the caller only checks error pointers with IS_ERR(),
NULL could bypass the check and lead to an invalid dereference.

Fix the issue by checking if devm_ioremap() returns NULL. When it does,
qmp_usb_iomap() now returns an error pointer via IOMEM_ERR_PTR(-ENOMEM),
ensuring safe and consistent error handling.

Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Fixes: a5d6b1ac56 ("phy: qcom-qmp-usb: fix memleak on probe deferral")
CC: Johan Hovold <johan@kernel.org>
CC: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250414125050.2118619-1-chenyuan0y@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-27 11:07:16 +01:00
..
allwinner
amlogic
broadcom phy: usb: Toggle the PHY power during init 2025-01-02 10:30:50 +01:00
cadence
freescale phy: freescale: imx8m-pcie: Add one missing error return 2025-05-02 07:47:10 +02:00
hisilicon
ingenic
intel
lantiq
marvell
mediatek
microchip
motorola
mscc
qualcomm phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug 2025-06-27 11:07:16 +01:00
ralink
renesas phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off 2025-06-04 14:40:01 +02:00
rockchip phy: rockchip: naneng-combphy: compatible reset with old DT 2025-03-07 16:56:47 +01:00
samsung phy: exynos5-usbdrd: fix MPLL_MULTIPLIER and SSC_REFCLKSEL masks in refclk 2025-03-07 16:56:50 +01:00
socionext
st
sunplus
tegra phy: Fix error handling in tegra_xusb_port_init 2025-05-22 14:10:06 +02:00
ti
xilinx
Kconfig
Makefile
phy-can-transceiver.c
phy-core-mipi-dphy.c
phy-core.c phy: core: don't require set_mode() callback for phy_get_mode() to work 2025-06-04 14:40:14 +02:00
phy-lgm-usb.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c