[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1605180239-1792-1-git-send-email-zhangchangzhong@huawei.com>
Date: Thu, 12 Nov 2020 19:23:59 +0800
From: Zhang Changzhong <zhangchangzhong@...wei.com>
To: <andrew@...n.ch>, <hkallweit1@...il.com>, <linux@...linux.org.uk>,
<davem@...emloft.net>, <kuba@...nel.org>,
<m.felsch@...gutronix.de>, <f.fainelli@...il.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe()
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@...wei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.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
Powered by blists - more mailing lists