net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup()
[ Upstream commit c69c29a1a0a8f68cd87e98ba4a5a79fb8ef2a58c ] If phy_power_on() fails in rk_gmac_powerup(), clocks are left enabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f398c84acf
commit
ec1f9572c8
1 changed files with 3 additions and 1 deletions
|
@ -535,8 +535,10 @@ static int rk_gmac_init(struct platform_device *pdev, void *priv)
|
|||
int ret;
|
||||
|
||||
ret = phy_power_on(bsp_priv, true);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
gmac_clk_enable(bsp_priv, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = gmac_clk_enable(bsp_priv, true);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue