[patch 1/9] mm: vmalloc allocator off by one

npiggin
2008-11-08T02:15:13Z

[-- Attachment #1: mm-vmalloc-gap-fix.patch --]
[-- Type: text/plain, Size: 793 bytes --]

Fix off by one bug in the KVA allocator that can leave gaps in the
address space.

Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c
+++ linux-2.6/mm/vmalloc.c
@@ -362,7 +363,7 @@ retry:
goto found;
}

- while (addr + size >= first->va_start && addr + size <= vend) {
+ while (addr + size > first->va_start && addr + size <= vend) {
addr = ALIGN(first->va_end + PAGE_SIZE, align);

n = rb_next(&first->rb_node);