提交 9826e393 编写于 作者: M Miaoqian Lin 提交者: Joerg Roedel

iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find

The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore.
Add the corresponding 'put_device()' in the error handling path.

Fixes: 765a9d1d ("iommu/tegra-smmu: Fix mc errors on tegra124-nyan")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Acked-by: NThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20220107080915.12686-1-linmq006@gmail.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
上级 b0083376
......@@ -808,8 +808,10 @@ static struct tegra_smmu *tegra_smmu_find(struct device_node *np)
return NULL;
mc = platform_get_drvdata(pdev);
if (!mc)
if (!mc) {
put_device(&pdev->dev);
return NULL;
}
return mc->smmu;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册