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

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-19 15:28:29 +02:00
..
allwinner
amlogic
broadcom phy: usb: Toggle the PHY power during init 2025-01-02 10:32:02 +01:00
cadence phy: cadence-torrent: Check return value on register read 2024-08-03 08:54:35 +02:00
freescale phy: freescale: imx8m-pcie: assert phy reset and perst in power off 2025-04-25 10:45:36 +02:00
hisilicon
ingenic
intel
lantiq
marvell phy: marvell: a3700-comphy: Fix hardcoded array size 2024-05-02 16:32:48 +02:00
mediatek
microchip
motorola
mscc
qualcomm phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug 2025-06-19 15:28:29 +02:00
ralink
renesas phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off 2025-06-04 14:41:52 +02:00
rockchip phy: rockchip: naneng-combphy: compatible reset with old DT 2025-03-07 16:45:43 +01:00
samsung phy: exynos5-usbdrd: fix MPLL_MULTIPLIER and SSC_REFCLKSEL masks in refclk 2025-03-07 16:45:47 +01:00
socionext
st
starfive phy: starfive: jh7110-usb: Fix USB 2.0 host occasional detection failure 2025-06-04 14:42:25 +02:00
sunplus
tegra phy: tegra: xusb: remove a stray unlock 2025-05-22 14:12:26 +02:00
ti phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered 2024-05-02 16:32:49 +02:00
xilinx phy: zynqmp: Take the phy mutex in xlate 2024-09-12 11:11:35 +02:00
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:42:09 +02:00
phy-lgm-usb.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c