mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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: b17336c55d ("iommu/mediatek: add support for mtk iommu generation one HW")
Cc: stable@vger.kernel.org # 4.8
Cc: Honghui Zhang <honghui.zhang@mediatek.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
committed by
Joerg Roedel
parent
4f2a4aec1c
commit
c77ad28bfe
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user