[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201126133825.3643852-1-yangyingliang@huawei.com>
Date: Thu, 26 Nov 2020 21:38:25 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <iommu@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>
CC: <will@...nel.org>, <joro@...tes.org>, <yangyingliang@...wei.com>
Subject: [PATCH v2] iommu: return error code when it can't get group
It's better to return error code if it can't get group
in iommu_probe_device(). It's no function change.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.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
Powered by blists - more mailing lists