]> Gentwo Git Trees - linux/.git/commitdiff
iommu/mediatek: fix device leak on of_xlate()
authorJohan Hovold <johan@kernel.org>
Mon, 20 Oct 2025 04:53:09 +0000 (06:53 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 17 Nov 2025 08:49:43 +0000 (09:49 +0100)
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>
drivers/iommu/mtk_iommu.c

index 9747ef1644138ee105d0195682b9c2f9fc2380f2..82a55fe19a6286713cce4c90fbecec1b6c916e37 100644 (file)
@@ -974,6 +974,8 @@ static int mtk_iommu_of_xlate(struct device *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);