X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=mm%2Fvmalloc.c;h=266162d2ba28254a9c8ca4366a8262d81d032f3c;hb=0f71a3738c91c3b8da60c63b04557ebd6060a1ea;hp=35f8553f893a7ffe0416732827c71385646c4ea3;hpb=37224470c8c6d90a4062e76a08d4dc1fcf91fc89;p=linux-2.6-omap-h63xx.git diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 35f8553f893..266162d2ba2 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -330,6 +330,8 @@ void __vunmap(void *addr, int deallocate_pages) return; } + debug_check_no_locks_freed(addr, area->size); + if (deallocate_pages) { int i; @@ -338,7 +340,7 @@ void __vunmap(void *addr, int deallocate_pages) __free_page(area->pages[i]); } - if (area->nr_pages > PAGE_SIZE/sizeof(struct page *)) + if (area->flags & VM_VPAGES) vfree(area->pages); else kfree(area->pages); @@ -425,9 +427,10 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, area->nr_pages = nr_pages; /* Please note that the recursion is strictly bounded. */ - if (array_size > PAGE_SIZE) + if (array_size > PAGE_SIZE) { pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node); - else + area->flags |= VM_VPAGES; + } else pages = kmalloc_node(array_size, (gfp_mask & ~__GFP_HIGHMEM), node); area->pages = pages; if (!area->pages) {