linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe()
@ 2020-11-12 11:23 Zhang Changzhong
  2020-11-14 19:26 ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang Changzhong @ 2020-11-12 11:23 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, kuba, m.felsch, f.fainelli
  Cc: netdev, linux-kernel

Add the missing clk_disable_unprepare() before return from
smsc_phy_probe() in the error handling case.

Fixes: bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 drivers/net/phy/smsc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index ec97669..0fc39ac 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -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;
 }
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-16 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 11:23 [PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe() Zhang Changzhong
2020-11-14 19:26 ` Jakub Kicinski
2020-11-14 19:45   ` Florian Fainelli
2020-11-16  9:26     ` Marco Felsch
2020-11-16 17:45       ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).