Skip to content

Commit

Permalink
net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe()
Browse files Browse the repository at this point in the history
Add the missing clk_disable_unprepare() before return from
smsc_phy_probe() in the error handling case.

Fixes: bedd8d7 ("net: phy: smsc: LAN8710/20: add phy refclk in support")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhang Changzhong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Zhang Changzhong authored and kuba-moo committed Nov 14, 2020
1 parent ceb736e commit 3734471
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/phy/smsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,10 @@ static int smsc_phy_probe(struct phy_device *phydev)
return ret;

ret = clk_set_rate(priv->refclk, 50 * 1000 * 1000);
if (ret)
if (ret) {
clk_disable_unprepare(priv->refclk);
return ret;
}

return 0;
}
Expand Down

0 comments on commit 3734471

Please sign in to comment.