summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2025-10-20 07:53:16 +0300
committerJoerg Roedel <joerg.roedel@amd.com>2025-11-17 11:49:45 +0300
commit13e1d629d8eda8505d6d4227ab0bd3b0ad898534 (patch)
tree0ea675c07234af5ea0d2aaefb375323cef3d4b05
parentb5870691065e6bbe6ba0650c0412636c6a239c5a (diff)
downloadlinux-13e1d629d8eda8505d6d4227ab0bd3b0ad898534.tar.xz
iommu/omap: simplify probe_device() error handling
Simplify the probe_device() error handling by dropping the iommu OF node reference sooner. Acked-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r--drivers/iommu/omap-iommu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 1c995463cfb0..768973b7e511 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1668,8 +1668,8 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
}
pdev = of_find_device_by_node(np);
+ of_node_put(np);
if (!pdev) {
- of_node_put(np);
kfree(arch_data);
return ERR_PTR(-ENODEV);
}
@@ -1677,14 +1677,11 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
oiommu = platform_get_drvdata(pdev);
put_device(&pdev->dev);
if (!oiommu) {
- of_node_put(np);
kfree(arch_data);
return ERR_PTR(-EINVAL);
}
tmp->iommu_dev = oiommu;
-
- of_node_put(np);
}
dev_iommu_priv_set(dev, arch_data);