Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83043
b: refs/heads/master
c: bf53d6f
h: refs/heads/master
i:
  83041: 1fb56c1
  83039: ffea3e8
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 5, 2008
1 parent dd166ef commit d2b05e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e2779fa281cfda13ac060753d674bbcaa23367e
refs/heads/master: bf53d6f8fa467397a16de2a2500312ae26528d34
16 changes: 11 additions & 5 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ static void __vunmap(const void *addr, int deallocate_pages)
int i;

for (i = 0; i < area->nr_pages; i++) {
BUG_ON(!area->pages[i]);
__free_page(area->pages[i]);
struct page *page = area->pages[i];

BUG_ON(!page);
__free_page(page);
}

if (area->flags & VM_VPAGES)
Expand Down Expand Up @@ -489,15 +491,19 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
}

for (i = 0; i < area->nr_pages; i++) {
struct page *page;

if (node < 0)
area->pages[i] = alloc_page(gfp_mask);
page = alloc_page(gfp_mask);
else
area->pages[i] = alloc_pages_node(node, gfp_mask, 0);
if (unlikely(!area->pages[i])) {
page = alloc_pages_node(node, gfp_mask, 0);

if (unlikely(!page)) {
/* Successfully allocated i pages, free them in __vunmap() */
area->nr_pages = i;
goto fail;
}
area->pages[i] = page;
}

if (map_vm_area(area, prot, &pages))
Expand Down

0 comments on commit d2b05e4

Please sign in to comment.