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

iommu/apple-dart: 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: 46d1fb07 ("iommu/dart: Add DART iommu driver")
Cc: stable@vger.kernel.org	# 5.15
Cc: Sven Peter <sven@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 4fd24676
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -805,6 +805,8 @@ static int apple_dart_of_xlate(struct device *dev,
	struct apple_dart *cfg_dart;
	int i, sid;

	put_device(&iommu_pdev->dev);

	if (args->args_count != 1)
		return -EINVAL;
	sid = args->args[0];