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: 5d70499218 ("vfio/type1: Allow transparent MSI IOVA allocation")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
Wei Yongjun 2017-02-09 16:01:58 +00:00 committed by Joerg Roedel
parent a514a6e241
commit 2c9f1af528

View File

@ -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);