Skip to content

Commit aaac9a1

Browse files
seehearfeelvinodkoul
authored andcommitted
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. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Tiezhu Yang <[email protected]> Reviewed-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 6411e38 commit aaac9a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)