diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-06-25 13:44:28 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-22 09:33:01 +0200 |
commit | 1d08f59081e59cadbf9189faa2aa6ff3c71e4ec1 (patch) | |
tree | 5a185706169621c984a76b9811cc4f2f9377af9d /arch/arm64/boot/dts | |
parent | 684a5568df11e4206a30857390e4824ac829264d (diff) |
phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked
[ Upstream commit 38b1927e5bf9bcad4a2e33189ef1c5569f9599ba ]
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: e6f32efb1b12 ("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>
Diffstat (limited to 'arch/arm64/boot/dts')
0 files changed, 0 insertions, 0 deletions