mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
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: 4100b8c229 ("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>
This commit is contained in:
committed by
Joerg Roedel
parent
13e1d629d8
commit
f916109bf5
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user