Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3f92424 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit 142e821f68cf5da79ce722cb9c1323afae30e185 ]

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarYong Wu <yong.wu@mediatek.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/593e7b7d97c6e064b29716b091a9d4fd122241fb.1671473163.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ecfe33e0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
	ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL,
				     dev_name(&pdev->dev));
	if (ret)
		return ret;
		goto out_clk_unprepare;

	iommu_device_set_ops(&data->iommu, &mtk_iommu_ops);

@@ -651,6 +651,8 @@ static int mtk_iommu_probe(struct platform_device *pdev)
	iommu_device_unregister(&data->iommu);
out_sysfs_remove:
	iommu_device_sysfs_remove(&data->iommu);
out_clk_unprepare:
	clk_disable_unprepare(data->bclk);
	return ret;
}