Skip to content

Commit 142e821

Browse files
tititiou36joergroedel
authored andcommitted
iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe()
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: b17336c ("iommu/mediatek: add support for mtk iommu generation one HW") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Yong Wu <yong.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/r/593e7b7d97c6e064b29716b091a9d4fd122241fb.1671473163.git.christophe.jaillet@wanadoo.fr Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent dcdb3ba commit 142e821

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iommu/mtk_iommu_v1.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev)
683683
ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL,
684684
dev_name(&pdev->dev));
685685
if (ret)
686-
return ret;
686+
goto out_clk_unprepare;
687687

688688
ret = iommu_device_register(&data->iommu, &mtk_iommu_v1_ops, dev);
689689
if (ret)
@@ -698,6 +698,8 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev)
698698
iommu_device_unregister(&data->iommu);
699699
out_sysfs_remove:
700700
iommu_device_sysfs_remove(&data->iommu);
701+
out_clk_unprepare:
702+
clk_disable_unprepare(data->bclk);
701703
return ret;
702704
}
703705

0 commit comments

Comments
 (0)