Skip to contentSkip to conversation

vfio/type1: Fix build warning

PATCH New Alex Williamson 1 participant 1 message May 31, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/type1: Fix build warning

This function cannot actually be called with npage = 0, so in practice this doesn't return an uninitialized value.

---
 drivers/vfio/vfio_iommu_type1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vfio/vfio_iommu_type1.c +1 -1
index 15a6582..2ba1942 100644
@@ -515,7 +515,7 @@ static int map_try_harder(struct vfio_domain *domain, dma_addr_t iova,
 			  unsigned long pfn, long npage, int prot)
 {
 	long i;
-	int ret;
+	int ret = 0;
 
 	for (i = 0; i < npage; i++, pfn++, iova += PAGE_SIZE) {
 		ret = iommu_map(domain->domain, iova,