iommu/amd: Missing error code in amd_iommu_init_device()
Subsystems (2)
PATCH 1/1 iommu/amd: Missing error code in amd_iommu_init_device()
We should set "ret" to -EINVAL if iommu_group_get() fails.
Fixes 55c99a4dc50f ("iommu/amd: Use iommu_attach_group()")
Signed-off-by Dan Carpenter <[email protected]>
drivers/iommu/amd_iommu_v2.c +3 -1
@@ -805,8 +805,10 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids) goto out_free_domain; group =iommu_group_get (&pdev->dev); -if (!group) +if (!group) { + ret = -EINVAL ; goto out_free_domain; + } ret =iommu_attach_group (dev_state->domain, group);if (ret !=0 )
Quoted 4 lines · Dan Carpenter
We should set "ret" to
-EINVALifiommu_group_get()fails.Fixes 55c99a4dc50f ("iommu/amd: Use iommu_attach_group()")Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks.