From: Johan Hovold Date: Mon, 20 Oct 2025 04:53:12 +0000 (+0200) Subject: iommu/mediatek-v1: fix device leak on probe_device() X-Git-Tag: v6.19-rc1~133^2^8~14 X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=c77ad28bfee0df9cbc719eb5adc9864462cfb65b;p=linux%2F.git iommu/mediatek-v1: fix device leak on probe_device() Make sure to drop the reference taken to the iommu platform device when looking up its driver data during probe_device(). Fixes: b17336c55d89 ("iommu/mediatek: add support for mtk iommu generation one HW") Cc: stable@vger.kernel.org # 4.8 Cc: Honghui Zhang Acked-by: Robin Murphy Reviewed-by: Yong Wu Signed-off-by: Johan Hovold Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 3b45650263ac..363c61a0009c 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -438,6 +438,8 @@ static int mtk_iommu_v1_create_mapping(struct device *dev, return -EINVAL; dev_iommu_priv_set(dev, platform_get_drvdata(m4updev)); + + put_device(&m4updev->dev); } ret = iommu_fwspec_add_ids(dev, args->args, 1);