Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299392
b: refs/heads/master
c: b3dc627
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Apr 20, 2012
1 parent 9b26732 commit 6c41265
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: 310eb776501af8412c570c4bcddc9ab5cecf3d7a
refs/heads/master: b3dc627cabb33fc95f93da78457770c1b2a364d2
7 changes: 6 additions & 1 deletion trunk/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6c41265

Please sign in to comment.