linux-stable/drivers/phy
Colin Ian King 5738628f34 phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked
[ Upstream commit 38b1927e5b ]

Currently pointer phy0 is being dereferenced via the assignment of
phy on the call to phy_get_drvdata before phy0 is null checked, this
can lead to a null pointer dereference. Fix this by performing the
null check on phy0 before the call to phy_get_drvdata. Also replace
the phy0 == NULL check with the more usual !phy0 idiom.

Addresses-Coverity: ("Dereference before null check")
Fixes: e6f32efb1b ("phy: sun4i-usb: Make sure to disable PHY0 passby for peripheral mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200625124428.83564-1-colin.king@canonical.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-22 09:22:24 +02:00
..
allwinner phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked 2020-07-22 09:22:24 +02:00
amlogic
broadcom phy: brcm-sata: allow PHY_BRCM_SATA driver to be built for DSL SoCs 2019-11-20 18:00:32 +01:00
hisilicon
lantiq phy: lantiq: Fix compile warning 2019-11-20 18:00:41 +01:00
marvell
mediatek phy: phy-mtk-tphy: use auto instead of force to bypass utmi signals 2018-08-15 18:12:48 +02:00
motorola phy: cpcap-usb: Prevent USB line glitches from waking up modem 2020-02-05 14:18:05 +00:00
qualcomm phy: qualcomm: Adjust indentation in read_poll_timeout 2020-02-14 16:32:17 -05:00
ralink
renesas phy: renesas: rcar-gen3-usb2: Fix sysfs interface of "role" 2019-12-17 20:39:52 +01:00
rockchip
samsung
st
tegra phy: tegra: remove redundant self assignment of 'map' 2019-02-27 10:08:09 +01:00
ti phy: phy-twl4030-usb: fix denied runtime access 2019-11-20 18:00:33 +01:00
Kconfig
Makefile
phy-core.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c