From: Johan Hovold Date: Mon, 20 Oct 2025 04:53:05 +0000 (+0200) Subject: iommu/apple-dart: fix device leak on of_xlate() X-Git-Tag: v5.15.198~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac0c50cc85edf9aad5b9ffd5e650ae94a99ba925;p=thirdparty%2Fkernel%2Fstable.git iommu/apple-dart: fix device leak on of_xlate() commit a6eaa872c52a181ae9a290fd4e40c9df91166d7a upstream. Make sure to drop the reference taken to the iommu platform device when looking up its driver data during of_xlate(). Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver") Cc: stable@vger.kernel.org # 5.15 Cc: Sven Peter Acked-by: Robin Murphy Signed-off-by: Johan Hovold Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index baba4571c8152..ae8f1c52f7763 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -611,6 +611,8 @@ static int apple_dart_of_xlate(struct device *dev, struct of_phandle_args *args) struct apple_dart *cfg_dart; int i, sid; + put_device(&iommu_pdev->dev); + if (args->args_count != 1) return -EINVAL; sid = args->args[0];