diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-05-02 14:33:57 -0400 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-05-02 14:33:57 -0400 |
| commit | 1fb5fef9b80d9a3b5368e22031627afd1585487b (patch) | |
| tree | 54f07a532b5b2622b8642156bbcaeca637fcdb8f /mm/sparse.c | |
| parent | 1a2e8a6f8ec0a068911a882a19e0912a0c89be6e (diff) | |
| parent | 330ab71619bacc4d4494227a6cfc9b7f5500403d (diff) | |
Merge branch 'master' into upstream
Diffstat (limited to 'mm/sparse.c')
| -rw-r--r-- | mm/sparse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index 0a51f36ba3a1..d7c32de99ee8 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
| @@ -32,7 +32,10 @@ static struct mem_section *sparse_index_alloc(int nid) | |||
| 32 | unsigned long array_size = SECTIONS_PER_ROOT * | 32 | unsigned long array_size = SECTIONS_PER_ROOT * |
| 33 | sizeof(struct mem_section); | 33 | sizeof(struct mem_section); |
| 34 | 34 | ||
| 35 | section = alloc_bootmem_node(NODE_DATA(nid), array_size); | 35 | if (system_state == SYSTEM_RUNNING) |
| 36 | section = kmalloc_node(array_size, GFP_KERNEL, nid); | ||
| 37 | else | ||
| 38 | section = alloc_bootmem_node(NODE_DATA(nid), array_size); | ||
| 36 | 39 | ||
| 37 | if (section) | 40 | if (section) |
| 38 | memset(section, 0, array_size); | 41 | memset(section, 0, array_size); |
| @@ -281,9 +284,9 @@ int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | |||
| 281 | 284 | ||
| 282 | ret = sparse_init_one_section(ms, section_nr, memmap); | 285 | ret = sparse_init_one_section(ms, section_nr, memmap); |
| 283 | 286 | ||
| 284 | if (ret <= 0) | ||
| 285 | __kfree_section_memmap(memmap, nr_pages); | ||
| 286 | out: | 287 | out: |
| 287 | pgdat_resize_unlock(pgdat, &flags); | 288 | pgdat_resize_unlock(pgdat, &flags); |
| 289 | if (ret <= 0) | ||
| 290 | __kfree_section_memmap(memmap, nr_pages); | ||
| 288 | return ret; | 291 | return ret; |
| 289 | } | 292 | } |
