diff options
author | 2017-02-09 16:01:58 +0000 | |
---|---|---|
committer | 2017-02-10 15:09:11 +0100 | |
commit | 2c9f1af528a4581e8ef8590108daa3c3df08dd5a (patch) | |
tree | 53269e4f52fb79cb2c9fee764a4986283b38107b /drivers/vfio/vfio_iommu_type1.c | |
parent | iommu: Fix static checker warning in iommu_insert_device_resv_regions (diff) | |
download | linux-2c9f1af528a4581e8ef8590108daa3c3df08dd5a.tar.gz linux-2c9f1af528a4581e8ef8590108daa3c3df08dd5a.tar.bz2 linux-2c9f1af528a4581e8ef8590108daa3c3df08dd5a.zip |
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/vfio/vfio_iommu_type1.c')
-rw-r--r-- | drivers/vfio/vfio_iommu_type1.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 0f353f519574..bd6f293c4ebd 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -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); |