Commit b54dcc3b authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

iommu/amd: Missing error code in amd_iommu_init_device()

commit 24c790fb upstream.

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46105512
......@@ -809,8 +809,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)
......
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