iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu: fix return error code in iommu_probe_device()
@ 2020-11-17  2:52 Yang Yingliang
  2020-11-17  9:40 ` Lu Baolu
  0 siblings, 1 reply; 8+ messages in thread
From: Yang Yingliang @ 2020-11-17  2:52 UTC (permalink / raw)
  To: iommu, linux-kernel; +Cc: yangyingliang

If iommu_group_get() failed, it need return error code
in iommu_probe_device().

Fixes: cf193888bfbd ("iommu: Move new probe_device path...")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/iommu/iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index b53446bb8c6b..6f4a32df90f6 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -253,8 +253,10 @@ int iommu_probe_device(struct device *dev)
 		goto err_out;
 
 	group = iommu_group_get(dev);
-	if (!group)
+	if (!group) {
+		ret = -ENODEV;
 		goto err_release;
+	}
 
 	/*
 	 * Try to allocate a default domain - needs support from the
-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2020-11-26  8:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  2:52 [PATCH] iommu: fix return error code in iommu_probe_device() Yang Yingliang
2020-11-17  9:40 ` Lu Baolu
2020-11-17 11:11   ` Yang Yingliang
2020-11-17 22:41     ` Will Deacon
2020-11-25  1:54       ` Yang Yingliang
2020-11-25 11:35         ` Will Deacon
2020-11-26  2:29           ` Yang Yingliang
2020-11-26  8:59             ` Will Deacon

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