linux/drivers/phy
Colin Ian King 38b1927e5b phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked
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>
2020-06-25 18:25:37 +05:30
..
allwinner phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked 2020-06-25 18:25:37 +05:30
amlogic USB: changes for v5.8 merge window 2020-05-25 13:28:20 +02:00
broadcom drivers: phy: sr-usb: do not use internal fsm for USB2 phy init 2020-05-18 19:30:56 +05:30
cadence phy: cadence: sierra: Fix for USB3 U1/U2 state 2020-05-18 19:30:56 +05:30
freescale phy: for 5.3 2019-07-01 15:04:59 +02:00
hisilicon phy: hisilicon: Fix Kconfig indentation 2019-12-20 17:00:45 +05:30
intel phy: intel: fix enum type mismatch warning 2020-06-24 17:41:40 +05:30
lantiq phy: lantiq: vrx200-pcie: Remove unneeded semicolon 2020-01-08 12:58:06 +05:30
marvell USB/Thunderbolt/PHY driver updates for 5.6-rc1 2020-01-29 10:09:44 -08:00
mediatek phy: phy-mtk-tphy: add a new reference clock 2020-03-20 19:34:29 +05:30
motorola phy: cpcap-usb: Remove some useless code 2020-05-13 08:27:35 +05:30
mscc treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
qualcomm phy: for 5.8 2020-05-22 09:28:16 +02:00
ralink treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
renesas phy: renesas: phy-rcar-gen2: Fix the array off by one warning 2019-10-31 16:54:01 +05:30
rockchip phy: rockchip: Fix return value of inno_dsidphy_probe() 2020-06-24 18:29:09 +05:30
samsung phy: samsung: s5pv210-usb2: Add delay after reset 2020-05-13 08:27:35 +05:30
socionext phy: uniphier-pcie: Add SoC-dependent phy-mode function support 2020-03-20 19:34:29 +05:30
st treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tegra phy: tegra: Select USB_COMMON for usb_get_maximum_speed() 2020-04-24 13:12:14 +05:30
ti phy: ti: j721e-wiz: Constify structs 2020-06-24 18:26:39 +05:30
Kconfig phy: intel-lgm-emmc: Add support for eMMC PHY 2020-01-14 10:50:19 +05:30
Makefile phy: intel-lgm-emmc: Add support for eMMC PHY 2020-01-14 10:50:19 +05:30
phy-core-mipi-dphy.c phy: dphy: Change units of wakeup and init parameters 2019-02-07 11:11:05 +05:30
phy-core.c phy: core: Fix phy_get() to not return error on link creation failure 2020-02-19 16:02:02 +05:30
phy-lpc18xx-usb-otg.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
phy-pistachio-usb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
phy-xgene.c phy: xgene: make array serdes_reg static const, makes object smaller 2019-10-23 13:20:26 +05:30