mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
iommu/mediatek-v1: fix device leak on probe_device()
commit c77ad28bfee0df9cbc719eb5adc9864462cfb65b upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
83a8e18f30
commit
e7bcedf59b
@@ -420,6 +420,8 @@ static int mtk_iommu_v1_create_mapping(struct device *dev, struct of_phandle_arg
|
||||
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