summaryrefslogtreecommitdiff
path: root/mm/memblock.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-05-10 11:51:07 +0900
committerPaul Mundt <lethal@linux-sh.org>2012-05-10 11:51:07 +0900
commit15f99cbd071aa402e113d342448603344a337046 (patch)
tree56f98892d1bd38029988eb8931e2321ef7e79aa0 /mm/memblock.c
parentb2212ea41dacda8cce0e7681a3a6ccc76c63802e (diff)
parent41797f75486d8ca3b98d7658c2a506ac7879a8e5 (diff)
Merge branch 'sh/rsk-updates' into sh-latest
Conflicts: arch/sh/Kconfig Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 99f285599501..a44eab3157f8 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -330,6 +330,9 @@ static int __init_memblock memblock_add_region(struct memblock_type *type,
phys_addr_t end = base + memblock_cap_size(base, &size);
int i, nr_new;
+ if (!size)
+ return 0;
+
/* special case for empty array */
if (type->regions[0].size == 0) {
WARN_ON(type->cnt != 1 || type->total_size);
@@ -430,6 +433,9 @@ static int __init_memblock memblock_isolate_range(struct memblock_type *type,
*start_rgn = *end_rgn = 0;
+ if (!size)
+ return 0;
+
/* we'll create at most two more regions */
while (type->cnt + 2 > type->max)
if (memblock_double_array(type) < 0)
@@ -514,7 +520,6 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
(unsigned long long)base,
(unsigned long long)base + size,
(void *)_RET_IP_);
- BUG_ON(0 == size);
return memblock_add_region(_rgn, base, size, MAX_NUMNODES);
}