| From b3f1ee18280363ef17f82b564fc379ceba9ec86f Mon Sep 17 00:00:00 2001 |
| From: Johan Hovold <johan@kernel.org> |
| Date: Mon, 20 Oct 2025 06:53:09 +0200 |
| Subject: iommu/mediatek: fix device leak on of_xlate() |
| |
| From: Johan Hovold <johan@kernel.org> |
| |
| commit b3f1ee18280363ef17f82b564fc379ceba9ec86f upstream. |
| |
| Make sure to drop the reference taken to the iommu platform device when |
| looking up its driver data during of_xlate(). |
| |
| Fixes: 0df4fabe208d ("iommu/mediatek: Add mt8173 IOMMU driver") |
| Cc: stable@vger.kernel.org # 4.6 |
| Acked-by: Robin Murphy <robin.murphy@arm.com> |
| Reviewed-by: Yong Wu <yong.wu@mediatek.com> |
| Signed-off-by: Johan Hovold <johan@kernel.org> |
| Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> |
| Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| drivers/iommu/mtk_iommu.c | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| --- a/drivers/iommu/mtk_iommu.c |
| +++ b/drivers/iommu/mtk_iommu.c |
| @@ -894,6 +894,8 @@ static int mtk_iommu_of_xlate(struct dev |
| return -EINVAL; |
| |
| dev_iommu_priv_set(dev, platform_get_drvdata(m4updev)); |
| + |
| + put_device(&m4updev->dev); |
| } |
| |
| return iommu_fwspec_add_ids(dev, args->args, 1); |