提交 dc08f3b1 编写于 作者: C Christophe JAILLET 提交者: sanglipeng

iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe()

stable inclusion
from stable-v5.10.164
commit caaea2ab6b6d48f1261ead8c8737502bcf47c297
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=caaea2ab6b6d48f1261ead8c8737502bcf47c297

--------------------------------

[ Upstream commit 142e821f ]

A clk, prepared and enabled in mtk_iommu_v1_hw_init(), is not released in
the error handling path of mtk_iommu_v1_probe().

Add the corresponding clk_disable_unprepare(), as already done in the
remove function.

Fixes: b17336c5 ("iommu/mediatek: add support for mtk iommu generation one HW")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: NYong Wu <yong.wu@mediatek.com>
Reviewed-by: NAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: NMatthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/593e7b7d97c6e064b29716b091a9d4fd122241fb.1671473163.git.christophe.jaillet@wanadoo.frSigned-off-by: NJoerg Roedel <jroedel@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 4643aef9
...@@ -618,7 +618,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) ...@@ -618,7 +618,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL, ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL,
dev_name(&pdev->dev)); dev_name(&pdev->dev));
if (ret) if (ret)
return ret; goto out_clk_unprepare;
iommu_device_set_ops(&data->iommu, &mtk_iommu_ops); iommu_device_set_ops(&data->iommu, &mtk_iommu_ops);
...@@ -643,6 +643,8 @@ static int mtk_iommu_probe(struct platform_device *pdev) ...@@ -643,6 +643,8 @@ static int mtk_iommu_probe(struct platform_device *pdev)
iommu_device_unregister(&data->iommu); iommu_device_unregister(&data->iommu);
out_sysfs_remove: out_sysfs_remove:
iommu_device_sysfs_remove(&data->iommu); iommu_device_sysfs_remove(&data->iommu);
out_clk_unprepare:
clk_disable_unprepare(data->bclk);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册