linux/drivers/phy/allwinner
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
..
Kconfig phy: Enable compile testing for some of drivers 2020-01-06 10:35:00 +01:00
Makefile phy: allwinner: add phy driver for USB3 PHY on Allwinner H6 SoC 2019-10-31 16:54:00 +05:30
phy-sun4i-usb.c phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked 2020-06-25 18:25:37 +05:30
phy-sun6i-mipi-dphy.c phy: Move Allwinner A31 D-PHY driver to drivers/phy/ 2019-02-07 09:34:49 +01:00
phy-sun9i-usb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
phy-sun50i-usb3.c phy: allwinner: Fix GENMASK misuse 2020-03-04 10:56:26 +01:00