iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/ipmmu-vmsa: fix device reference leaks
@ 2019-02-03 10:27 wen yang
  2019-02-11 10:24 ` joro
  0 siblings, 1 reply; 4+ messages in thread
From: wen yang @ 2019-02-03 10:27 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: wen yang, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Make sure to drop the reference to the device taken by
of_find_device_by_node() on driver unbind.

Signed-off-by: Wen Yang <yellowriver2010-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Cc: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
 drivers/iommu/ipmmu-vmsa.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 7a4529c..cebf56d 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -756,6 +756,9 @@ static int ipmmu_init_platform_device(struct device *dev,
 
 	fwspec->iommu_priv = platform_get_drvdata(ipmmu_pdev);
 
+	if (!fwspec->iommu_priv)
+		put_device(&ipmmu_pdev->dev);
+
 	return 0;
 }
 
-- 
2.7.4

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

end of thread, other threads:[~2019-02-15 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-03 10:27 [PATCH] iommu/ipmmu-vmsa: fix device reference leaks wen yang
2019-02-11 10:24 ` joro
2019-02-12 16:47   ` Laurent Pinchart
     [not found]     ` <20190212164722.GT6279-N3hz7ZxfLydczECFQUw77jytWr6r+dGw0E9HWUfgJXw@public.gmane.org>
2019-02-15 13:20       ` Wen Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).