Commit 2c9f1af5 authored by Wei Yongjun's avatar Wei Yongjun Committed by Joerg Roedel

vfio/type1: Fix error return code in vfio_iommu_type1_attach_group()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 5d704992 ("vfio/type1: Allow transparent MSI IOVA allocation")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent a514a6e2
......@@ -1332,8 +1332,11 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
if (ret)
goto out_detach;
if (resv_msi && iommu_get_msi_cookie(domain->domain, resv_msi_base))
goto out_detach;
if (resv_msi) {
ret = iommu_get_msi_cookie(domain->domain, resv_msi_base);
if (ret)
goto out_detach;
}
list_add(&domain->next, &iommu->domain_list);
......
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