projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d10fe7
)
iommu/amd: Handle return of iommu_device_sysfs_add
author
Bo Liu
<liubo03@inspur.com>
Fri, 1 Jul 2022 06:20:08 +0000
(
02:20
-0400)
committer
Joerg Roedel
<jroedel@suse.de>
Thu, 7 Jul 2022 07:37:06 +0000
(09:37 +0200)
As iommu_device_sysfs_add() can fail, we should check the return value.
Signed-off-by: Bo Liu <liubo03@inspur.com>
Link:
https://lore.kernel.org/r/20220701062008.6988-1-liubo03@inspur.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/init.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/amd/init.c
b/drivers/iommu/amd/init.c
index 1d08f87e734bd3af7a393bdf043bf53a395783f0..298c836e174f1e4bd24c55acd325dfcd195ff372 100644
(file)
--- a/
drivers/iommu/amd/init.c
+++ b/
drivers/iommu/amd/init.c
@@
-1906,8
+1906,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);