mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
iommu/mediatek: 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: 0df4fabe20 ("iommu/mediatek: Add mt8173 IOMMU driver")
Cc: stable@vger.kernel.org # 4.6
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:
parent
80aa518452
commit
b3f1ee1828
|
|
@ -974,6 +974,8 @@ static int mtk_iommu_of_xlate(struct device *dev,
|
|||
return -EINVAL;
|
||||
|
||||
dev_iommu_priv_set(dev, platform_get_drvdata(m4updev));
|
||||
|
||||
put_device(&m4updev->dev);
|
||||
}
|
||||
|
||||
return iommu_fwspec_add_ids(dev, args->args, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user