]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: sh_eth: fix a missing check of of_get_phy_mode
authorKangjie Lu <kjlu@umn.edu>
Tue, 12 Mar 2019 07:43:18 +0000 (02:43 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commitb9687858916e6b1ed5a42f4ae2cb6ad1352cabcd
tree97ee31c92dd95f2c6577912543f30bad198d774c
parent1b304c05788b52e2d741b3c4992d6fa46a4211b7
net: sh_eth: fix a missing check of of_get_phy_mode

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 035a14e71f27eefa50087963b94cbdb3580d08bf ]

of_get_phy_mode may fail and return a negative error code;
the fix checks the return value of of_get_phy_mode and
returns NULL of it fails.

Fixes: b356e978e92f ("sh_eth: add device tree support")
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/renesas/sh_eth.c