diff options
| author | Jens Axboe <axboe@kernel.dk> | 2012-07-30 03:03:10 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2012-07-30 03:03:10 -0400 |
| commit | 72ea1f74fcdf874cca6d2c0962379523bbd99e2c (patch) | |
| tree | 4c67be6c73356086ff44ef1b8b1c9479702689ca /mm/bootmem.c | |
| parent | b1af9be5ef77898c05667bb9dbf3b180d91d3292 (diff) | |
| parent | a73ff3231df59a4b92ccd0dd4e73897c5822489b (diff) | |
Merge branch 'for-jens' of git://git.drbd.org/linux-drbd into for-3.6/drivers
Diffstat (limited to 'mm/bootmem.c')
| -rw-r--r-- | mm/bootmem.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index ec4fcb7a56c8..bcb63ac48cc5 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
| @@ -698,7 +698,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, | |||
| 698 | return ___alloc_bootmem(size, align, goal, limit); | 698 | return ___alloc_bootmem(size, align, goal, limit); |
| 699 | } | 699 | } |
| 700 | 700 | ||
| 701 | static void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, | 701 | void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, |
| 702 | unsigned long size, unsigned long align, | 702 | unsigned long size, unsigned long align, |
| 703 | unsigned long goal, unsigned long limit) | 703 | unsigned long goal, unsigned long limit) |
| 704 | { | 704 | { |
| @@ -710,6 +710,10 @@ again: | |||
| 710 | if (ptr) | 710 | if (ptr) |
| 711 | return ptr; | 711 | return ptr; |
| 712 | 712 | ||
| 713 | /* do not panic in alloc_bootmem_bdata() */ | ||
| 714 | if (limit && goal + size > limit) | ||
| 715 | limit = 0; | ||
| 716 | |||
| 713 | ptr = alloc_bootmem_bdata(pgdat->bdata, size, align, goal, limit); | 717 | ptr = alloc_bootmem_bdata(pgdat->bdata, size, align, goal, limit); |
| 714 | if (ptr) | 718 | if (ptr) |
| 715 | return ptr; | 719 | return ptr; |
