Commit 83874d51 authored by Bo Liu's avatar Bo Liu Committed by Joerg Roedel

iommu/amd: Handle return of iommu_device_sysfs_add

As iommu_device_sysfs_add() can fail, we should check the return value.
Signed-off-by: default avatarBo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20220701062008.6988-1-liubo03@inspur.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 0d10fe75
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment