Commit aaac9a1b authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Vinod Koul
Browse files

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: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Reviewed-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1621420659-15858-1-git-send-email-yangtiezhu@loongson.cn


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 6411e386
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
	}