public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group()
@ 2017-02-09 16:01 Wei Yongjun
  2017-02-09 17:03 ` Auger Eric
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Yongjun @ 2017-02-09 16:01 UTC (permalink / raw)
  To: Alex Williamson, Eric Auger, Will Deacon; +Cc: Wei Yongjun, kvm

From: Wei Yongjun <weiyongjun1@huawei.com>

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>
---
 drivers/vfio/vfio_iommu_type1.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 0f353f5..bd6f293 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);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-10 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 16:01 [PATCH -next] vfio/type1: fix error return code in vfio_iommu_type1_attach_group() Wei Yongjun
2017-02-09 17:03 ` Auger Eric
2017-02-09 18:23   ` Alex Williamson
2017-02-10 11:56     ` Will Deacon
2017-02-10 12:51       ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox