summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2017-02-09 16:01:58 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:46 (GMT)
commit6af11dea1eb61ad8333a222c9578b57cdcdf9d0f (patch)
tree9e5597f194dbcd5b966a6962bfe80489c770a4ce /drivers
parent0a04918c1c3119a093ed84d660241ed7d67f8165 (diff)
downloadlinux-6af11dea1eb61ad8333a222c9578b57cdcdf9d0f.tar.xz
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: 5d704992189f ("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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/vfio/vfio_iommu_type1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 4bf3443..0d62729 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -850,8 +850,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);