Commit 24c790fb authored by Dan Carpenter's avatar Dan Carpenter Committed by Joerg Roedel

iommu/amd: Missing error code in amd_iommu_init_device()

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

Fixes: 55c99a4d ("iommu/amd: Use iommu_attach_group()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 62280cf2
...@@ -805,8 +805,10 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids) ...@@ -805,8 +805,10 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)
goto out_free_domain; goto out_free_domain;
group = iommu_group_get(&pdev->dev); group = iommu_group_get(&pdev->dev);
if (!group) if (!group) {
ret = -EINVAL;
goto out_free_domain; goto out_free_domain;
}
ret = iommu_attach_group(dev_state->domain, group); ret = iommu_attach_group(dev_state->domain, group);
if (ret != 0) if (ret != 0)
......
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