]> Gentwo Git Trees - linux/.git/commitdiff
iommu/sun50i: fix device leak on of_xlate()
authorJohan Hovold <johan@kernel.org>
Mon, 20 Oct 2025 04:53:17 +0000 (06:53 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 17 Nov 2025 08:49:45 +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: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Cc: stable@vger.kernel.org # 5.8
Cc: Maxime Ripard <mripard@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/sun50i-iommu.c

index d3b190be18b5a6d92e63a5684c95c6127949932e..90b26fe218176594815f08a77bba05ae574e8afe 100644 (file)
@@ -841,6 +841,8 @@ static int sun50i_iommu_of_xlate(struct device *dev,
 
        dev_iommu_priv_set(dev, platform_get_drvdata(iommu_pdev));
 
+       put_device(&iommu_pdev->dev);
+
        return iommu_fwspec_add_ids(dev, &id, 1);
 }