Skip to content

Commit 9a17907

Browse files
seehearfeelgregkh
authored andcommitted
phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init()
[ Upstream commit aaac9a1 ] Use clk_disable_unprepare() in the error path of mtk_phy_init() to fix some resource leaks. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1621420659-15858-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 02e2455 commit 9a17907

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/phy/mediatek/phy-mtk-tphy.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ static int mtk_phy_init(struct phy *phy)
949949
break;
950950
default:
951951
dev_err(tphy->dev, "incompatible PHY type\n");
952+
clk_disable_unprepare(instance->ref_clk);
953+
clk_disable_unprepare(instance->da_ref_clk);
952954
return -EINVAL;
953955
}
954956

0 commit comments

Comments
 (0)