* [PATCH v2] iommu: return error code when it can't get group
@ 2020-11-26 13:38 ` Yang Yingliang
0 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2020-11-26 13:38 UTC (permalink / raw)
To: iommu, linux-kernel; +Cc: will, joro, yangyingliang
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@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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] iommu: return error code when it can't get group
@ 2020-11-26 13:38 ` Yang Yingliang
0 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2020-11-26 13:38 UTC (permalink / raw)
To: iommu, linux-kernel; +Cc: will, yangyingliang
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@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] 4+ messages in thread
* Re: [PATCH v2] iommu: return error code when it can't get group
2020-11-26 13:38 ` Yang Yingliang
@ 2020-11-26 17:13 ` Will Deacon
-1 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2020-11-26 17:13 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, iommu
Cc: catalin.marinas, kernel-team, Will Deacon
On Thu, 26 Nov 2020 21:38:25 +0800, Yang Yingliang wrote:
> It's better to return error code if it can't get group
> in iommu_probe_device(). It's no function change.
Applied to arm64 (for-next/iommu/misc), thanks!
[1/1] iommu: return error code when it can't get group
https://git.kernel.org/arm64/c/058236eef606
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iommu: return error code when it can't get group
@ 2020-11-26 17:13 ` Will Deacon
0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2020-11-26 17:13 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, iommu
Cc: catalin.marinas, kernel-team, Will Deacon
On Thu, 26 Nov 2020 21:38:25 +0800, Yang Yingliang wrote:
> It's better to return error code if it can't get group
> in iommu_probe_device(). It's no function change.
Applied to arm64 (for-next/iommu/misc), thanks!
[1/1] iommu: return error code when it can't get group
https://git.kernel.org/arm64/c/058236eef606
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-26 17:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 13:38 [PATCH v2] iommu: return error code when it can't get group Yang Yingliang
2020-11-26 13:38 ` Yang Yingliang
2020-11-26 17:13 ` Will Deacon
2020-11-26 17:13 ` Will Deacon
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.