Commit f916109b authored by Johan Hovold's avatar Johan Hovold Committed by Joerg Roedel
Browse files

iommu/sun50i: fix device leak on of_xlate()



Make sure to drop the reference taken to the iommu platform device when
looking up its driver data during of_xlate().

Fixes: 4100b8c2 ("iommu: Add Allwinner H6 IOMMU driver")
Cc: stable@vger.kernel.org	# 5.8
Cc: Maxime Ripard <mripard@kernel.org>
Acked-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 13e1d629
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
}