mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 15:29:16 +00:00
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 <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>
This commit is contained in:
parent
6411e386db
commit
aaac9a1bd3
@ -949,6 +949,8 @@ static int mtk_phy_init(struct phy *phy)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(tphy->dev, "incompatible PHY type\n");
|
dev_err(tphy->dev, "incompatible PHY type\n");
|
||||||
|
clk_disable_unprepare(instance->ref_clk);
|
||||||
|
clk_disable_unprepare(instance->da_ref_clk);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user