Skip to content

Commit

Permalink
iommu/amd: Missing error code in amd_iommu_init_device()
Browse files Browse the repository at this point in the history
We should set "ret" to -EINVAL if iommu_group_get() fails.

Fixes: 55c99a4 ("iommu/amd: Use iommu_attach_group()")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
  • Loading branch information
Dan Carpenter authored and joergroedel committed Nov 29, 2016
1 parent 62280cf commit 24c790f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/iommu/amd_iommu_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 24c790f

Please sign in to comment.