[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1621257600-15046-1-git-send-email-yangtiezhu@loongson.cn>
Date: Mon, 17 May 2021 21:20:00 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Chunfeng Yun <chunfeng.yun@...iatek.com>,
Kishon Vijay Abraham I <kishon@...com>,
Vinod Koul <vkoul@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>
Cc: linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org, lkp@...el.com,
Dan Carpenter <dan.carpenter@...cle.com>,
Heiko Stuebner <heiko@...ech.de>, kbuild@...ts.01.org
Subject: [PATCH] phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init()
Use clk_disable_unprepare() in the error path of mtk_phy_init() to fix
some resource leaks.
Fixes: cd4ec4b03dc1 ("phy: phy-mt65xx-usb3: add mediatek directory and rename file")
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
drivers/phy/mediatek/phy-mtk-tphy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
index cdbcc49..731c483 100644
--- a/drivers/phy/mediatek/phy-mtk-tphy.c
+++ b/drivers/phy/mediatek/phy-mtk-tphy.c
@@ -949,6 +949,8 @@ static int mtk_phy_init(struct phy *phy)
break;
default:
dev_err(tphy->dev, "incompatible PHY type\n");
+ clk_disable_unprepare(instance->ref_clk);
+ clk_disable_unprepare(instance->da_ref_clk);
return -EINVAL;
}
--
2.1.0
Powered by blists - more mailing lists