]> Git Repo - linux.git/commitdiff
vfio/type1: Fix error return code in vfio_iommu_type1_attach_group()
authorWei Yongjun <[email protected]>
Thu, 9 Feb 2017 16:01:58 +0000 (16:01 +0000)
committerJoerg Roedel <[email protected]>
Fri, 10 Feb 2017 14:09:11 +0000 (15:09 +0100)
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]>
drivers/vfio/vfio_iommu_type1.c

index 0f353f5195747e7a3589666fb81d469664773a19..bd6f293c4ebd59b5f283ebc1193767c982e1f1ef 100644 (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);
 
This page took 0.058512 seconds and 4 git commands to generate.