]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Mar 2019 21:51:02 +0000 (14:51 -0700)
commite829d945ed49dc7cd67438255373a9483d49eaf5
tree7c8b035774a447e08c8e8699bec9b071383117f9
parenta9aaa5cbda0fe73e4c16a5df815f04e7916c2ab5
net: sh_eth: fix a missing check of of_get_phy_mode

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: 43e946cb1a9b ("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>
drivers/net/ethernet/renesas/sh_eth.c