Skip to contentSkip to conversation

iommu/amd: Missing error code in amd_iommu_init_device()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 24, 2016 – Nov 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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()")
drivers/iommu/amd_iommu_v2.c +3 -1
index 594849a..f8ed8c9 100644
@@ -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)
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

We should set "ret" to -EINVAL if iommu_group_get() fails.

Fixes 55c99a4dc50f ("iommu/amd: Use iommu_attach_group()")

Applied, thanks.