Skip to content

Commit 9826e39

Browse files
Yuuoniyjoergroedel
authored andcommitted
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: 765a9d1 ("iommu/tegra-smmu: Fix mc errors on tegra124-nyan") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20220107080915.12686-1-linmq006@gmail.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent b008337 commit 9826e39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iommu/tegra-smmu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,10 @@ static struct tegra_smmu *tegra_smmu_find(struct device_node *np)
808808
return NULL;
809809

810810
mc = platform_get_drvdata(pdev);
811-
if (!mc)
811+
if (!mc) {
812+
put_device(&pdev->dev);
812813
return NULL;
814+
}
813815

814816
return mc->smmu;
815817
}

0 commit comments

Comments
 (0)