* [PATCH] iommu/amd: Handle return of iommu_device_sysfs_add
@ 2022-07-01 6:20 Bo Liu
2022-07-06 11:38 ` Joerg Roedel
0 siblings, 1 reply; 2+ messages in thread
From: Bo Liu @ 2022-07-01 6:20 UTC (permalink / raw)
To: joro, will, suravee.suthikulpanit; +Cc: iommu, iommu, linux-kernel, Bo Liu
As iommu_device_sysfs_add() can fail, we should check the return value.
Signed-off-by: Bo Liu <liubo03@inspur.com>
---
drivers/iommu/amd/init.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 3c82d9c5f1c0..a3c4fdd40f04 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -2058,8 +2058,11 @@ static int __init iommu_init_pci(struct amd_iommu *iommu)
amd_iommu_erratum_746_workaround(iommu);
amd_iommu_ats_write_check_workaround(iommu);
- iommu_device_sysfs_add(&iommu->iommu, &iommu->dev->dev,
+ ret = iommu_device_sysfs_add(&iommu->iommu, &iommu->dev->dev,
amd_iommu_groups, "ivhd%d", iommu->index);
+ if (ret)
+ return ret;
+
iommu_device_register(&iommu->iommu, &amd_iommu_ops, NULL);
return pci_enable_device(iommu->dev);
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iommu/amd: Handle return of iommu_device_sysfs_add
2022-07-01 6:20 [PATCH] iommu/amd: Handle return of iommu_device_sysfs_add Bo Liu
@ 2022-07-06 11:38 ` Joerg Roedel
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2022-07-06 11:38 UTC (permalink / raw)
To: Bo Liu; +Cc: will, suravee.suthikulpanit, iommu, iommu, linux-kernel
On Fri, Jul 01, 2022 at 02:20:08AM -0400, Bo Liu wrote:
> As iommu_device_sysfs_add() can fail, we should check the return value.
>
> Signed-off-by: Bo Liu <liubo03@inspur.com>
> ---
> drivers/iommu/amd/init.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-06 11:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 6:20 [PATCH] iommu/amd: Handle return of iommu_device_sysfs_add Bo Liu
2022-07-06 11:38 ` Joerg Roedel
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).