Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212743
b: refs/heads/master
c: f1af98c
h: refs/heads/master
i:
  212741: f8b3e80
  212739: f540b5f
  212735: 2a49a03
v: v3
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Oct 6, 2010
1 parent 650e994 commit 1067a82
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: 1d931264af0f10649b35afa8fbd2e169da51ac08
refs/heads/master: f1af98c7629a1b76fd7336decbc776acdeed2120
7 changes: 6 additions & 1 deletion trunk/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,18 @@ static phys_addr_t __init memblock_find_region(phys_addr_t start, phys_addr_t en
phys_addr_t base, res_base;
long j;

/* In case, huge size is requested */
if (end < size)
return MEMBLOCK_ERROR;

base = memblock_align_down((end - size), align);

/* Prevent allocations returning 0 as it's also used to
* indicate an allocation failure
*/
if (start == 0)
start = PAGE_SIZE;

base = memblock_align_down((end - size), align);
while (start <= base) {
j = memblock_overlaps_region(&memblock.reserved, base, size);
if (j < 0)
Expand Down

0 comments on commit 1067a82

Please sign in to comment.