All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/omap: Fix missing put_device() call in omap_iommu_probe_device
@ 2022-01-07  8:04 ` Miaoqian Lin
  0 siblings, 0 replies; 12+ messages in thread
From: Miaoqian Lin @ 2022-01-07  8:04 UTC (permalink / raw)
  Cc: linmq006, Joerg Roedel, Will Deacon, Suman Anna, iommu, linux-kernel

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 paths.

Fixes: ede1c2e7d4dc ("iommu/omap: Store iommu_dev pointer in arch_data")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/iommu/omap-iommu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 91749654fd49..cbc7ca5e890a 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1684,6 +1684,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
 		oiommu = platform_get_drvdata(pdev);
 		if (!oiommu) {
 			of_node_put(np);
+			put_device(&pdev->dev);
 			kfree(arch_data);
 			return ERR_PTR(-EINVAL);
 		}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-01  6:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07  8:04 [PATCH] iommu/omap: Fix missing put_device() call in omap_iommu_probe_device Miaoqian Lin
2022-01-07  8:04 ` Miaoqian Lin
2022-01-07 14:42 ` Suman Anna
2022-01-07 14:42   ` Suman Anna via iommu
2022-01-10  2:43   ` Miaoqian Lin
2022-01-10  2:43     ` Miaoqian Lin
2022-01-10 18:43     ` Suman Anna
2022-01-10 18:43       ` Suman Anna via iommu
2022-01-12 11:54       ` Miaoqian Lin
2022-01-12 11:54         ` Miaoqian Lin
2022-03-01  6:33   ` [PATCH v2] " Miaoqian Lin
2022-03-01  6:33     ` Miaoqian Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.