Skip to content

Commit 2c9f1af

Browse files
Wei Yongjunjoergroedel
authored andcommitted
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: 5d70499 ("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>
1 parent a514a6e commit 2c9f1af

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/vfio/vfio_iommu_type1.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,8 +1332,11 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
13321332
if (ret)
13331333
goto out_detach;
13341334

1335-
if (resv_msi && iommu_get_msi_cookie(domain->domain, resv_msi_base))
1336-
goto out_detach;
1335+
if (resv_msi) {
1336+
ret = iommu_get_msi_cookie(domain->domain, resv_msi_base);
1337+
if (ret)
1338+
goto out_detach;
1339+
}
13371340

13381341
list_add(&domain->next, &iommu->domain_list);
13391342

0 commit comments

Comments
 (0)