Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 5d704992189f ("vfio/type1: Allow transparent MSI IOVA allocation")
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
Acked-by: Alex Williamson <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
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);