[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1605179495-818-1-git-send-email-zhangchangzhong@huawei.com>
Date: Thu, 12 Nov 2020 19:11:35 +0800
From: Zhang Changzhong <zhangchangzhong@...wei.com>
To: <hauke@...ke-m.de>, <andrew@...n.ch>, <vivien.didelot@...il.com>,
<f.fainelli@...il.com>, <olteanv@...il.com>, <davem@...emloft.net>,
<kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH net] net: dsa: lantiq_gswip: add missed clk_disable_unprepare() in gswip_gphy_fw_load()
Fix missing clk_disable_unprepare() before return from
gswip_gphy_fw_load() in the error handling case.
Fixes: 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.com>
---
drivers/net/dsa/lantiq_gswip.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index 74db81d..8936d65 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -1682,6 +1682,7 @@ static int gswip_gphy_fw_load(struct gswip_priv *priv, struct gswip_gphy_fw *gph
if (ret) {
dev_err(dev, "failed to load firmware: %s, error: %i\n",
gphy_fw->fw_name, ret);
+ clk_disable_unprepare(gphy_fw->clk_gate);
return ret;
}
@@ -1698,14 +1699,17 @@ static int gswip_gphy_fw_load(struct gswip_priv *priv, struct gswip_gphy_fw *gph
} else {
dev_err(dev, "failed to alloc firmware memory\n");
release_firmware(fw);
+ clk_disable_unprepare(gphy_fw->clk_gate);
return -ENOMEM;
}
release_firmware(fw);
ret = regmap_write(priv->rcu_regmap, gphy_fw->fw_addr_offset, dev_addr);
- if (ret)
+ if (ret) {
+ clk_disable_unprepare(gphy_fw->clk_gate);
return ret;
+ }
reset_control_deassert(gphy_fw->reset);
--
2.9.5
Powered by blists - more mailing lists