* [PATCH next] iommufd: Fix error code in iommu_device_register_bus()
@ 2025-09-30 12:25 Dan Carpenter
2025-09-30 12:54 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-09-30 12:25 UTC (permalink / raw)
To: Guixin Liu
Cc: Joerg Roedel, Will Deacon, Robin Murphy, Lu Baolu,
Jason Gunthorpe, iommu, linux-kernel, kernel-janitors
This error path accidentally returns success. Return
PTR_ERR(iommu->fwnode) instead.
Fixes: 885add2e6be6 ("iommufd: Register iommufd mock devices with fwspec")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/iommu/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index ddf398d8bcf9..59244c744eab 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -330,7 +330,7 @@ int iommu_device_register_bus(struct iommu_device *iommu,
iommu->fwnode = fwnode_create_software_node(NULL, NULL);
if (IS_ERR(iommu->fwnode)) {
bus_unregister_notifier(bus, nb);
- return err;
+ return PTR_ERR(iommu->fwnode);
}
spin_lock(&iommu_device_lock);
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH next] iommufd: Fix error code in iommu_device_register_bus()
2025-09-30 12:25 [PATCH next] iommufd: Fix error code in iommu_device_register_bus() Dan Carpenter
@ 2025-09-30 12:54 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2025-09-30 12:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Guixin Liu, Joerg Roedel, Will Deacon, Robin Murphy, Lu Baolu,
iommu, linux-kernel, kernel-janitors
On Tue, Sep 30, 2025 at 03:25:52PM +0300, Dan Carpenter wrote:
> iommu->fwnode = fwnode_create_software_node(NULL, NULL);
> if (IS_ERR(iommu->fwnode)) {
> bus_unregister_notifier(bus, nb);
> - return err;
> + return PTR_ERR(iommu->fwnode);
> }
Thanks Dan I fixed the commit
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-30 12:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-30 12:25 [PATCH next] iommufd: Fix error code in iommu_device_register_bus() Dan Carpenter
2025-09-30 12:54 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox