aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorVasant Hegde <vasant.hegde@amd.com>2024-08-28 11:10:25 +0000
committerJoerg Roedel <jroedel@suse.de>2024-09-04 11:35:55 +0200
commit293aa9ec694e633bff83ab93715a2684e15fe214 (patch)
tree4b0acc17a75fcfbf62bd356502c01523ae9f75d4
parentiommu/amd: Remove unused DTE_GCR3_INDEX_* macros (diff)
downloadwireguard-linux-293aa9ec694e633bff83ab93715a2684e15fe214.tar.xz
wireguard-linux-293aa9ec694e633bff83ab93715a2684e15fe214.zip
iommu/amd: Handle error path in amd_iommu_probe_device()
Do not try to set max_pasids in error path as dev_data is not allocated. Fixes: a0c47f233e68 ("iommu/amd: Introduce iommu_dev_data.max_pasids") Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Link: https://lore.kernel.org/r/20240828111029.5429-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to '')
-rw-r--r--drivers/iommu/amd/iommu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index f90fd106906c..51b226b9e727 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2187,11 +2187,12 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
dev_err(dev, "Failed to initialize - trying to proceed anyway\n");
iommu_dev = ERR_PTR(ret);
iommu_ignore_device(iommu, dev);
- } else {
- amd_iommu_set_pci_msi_domain(dev, iommu);
- iommu_dev = &iommu->iommu;
+ goto out_err;
}
+ amd_iommu_set_pci_msi_domain(dev, iommu);
+ iommu_dev = &iommu->iommu;
+
/*
* If IOMMU and device supports PASID then it will contain max
* supported PASIDs, else it will be zero.
@@ -2203,6 +2204,7 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
pci_max_pasids(to_pci_dev(dev)));
}
+out_err:
iommu_completion_wait(iommu);
return iommu_dev;