Skip to contentSkip to conversation

iommu: fix end address of vm area comparation in alloc_iovm_area

PATCH In review Fernando Guzman Lugo 2 participants 2 messages Aug 17, 2010 – Oct 10, 2010

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

PATCH 1/1 iommu: fix end address of vm area comparation in alloc_iovm_area

End address of the vm area is .start + bytes -1., not start + byte. This patch fixes that issue by doing an inclusive comparison with tmp->da_start. This issue was preventing allocate an area of size exactly the same than the free area. I did no change the value of da_end of each vm area because it is used to get area size in several places.

---
 arch/arm/plat-omap/iovmm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-omap/iovmm.c +1 -1
index 8ce0de2..24ca9c4 100644
@@ -292,7 +292,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
 		if (prev_end >= start)
 			break;
 
-		if (start + bytes < tmp->da_start)
+		if (start + bytes <= tmp->da_start)
 			goto found;
 
 		if (flags & IOVMF_DA_ANON)
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 9 lines · Fernando Guzman Lugo

End address of the vm area is .start + bytes -1., not start + byte. This patch fixes that issue by doing an inclusive comparison with tmp->da_start. This issue was preventing allocate an area of size exactly the same than the free area. I did no change the value of da_end of each vm area because it is used to get area size in several places.

Signature · 1 line
Felipe Contreras