mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
iommu/amd: Missing error code in amd_iommu_init_device()
commit24c790fbf5upstream. We should set "ret" to -EINVAL if iommu_group_get() fails. Fixes:55c99a4dc5("iommu/amd: Use iommu_attach_group()") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
54eed7ab13
commit
48ffae87e9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user