Skip to content

Commit

Permalink
[LMB]: Fix lmb_add_region if region should be added at the head
Browse files Browse the repository at this point in the history
We introduced a bug in fixing lmb_add_region to handle an initial
region being non-zero.  Before that fix it was impossible to insert a
region at the head of the list since the first region always started
at zero.

Now that its possible for the first region to be non-zero we need to
check to see if the new region should be added at the head and if so
actually add it.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kumar Gala authored and David S. Miller committed Feb 20, 2008
1 parent e5f2709 commit 74b20da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/lmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ static long __init lmb_add_region(struct lmb_region *rgn, u64 base, u64 size)
break;
}
}

if (base < rgn->region[0].base) {
rgn->region[0].base = base;
rgn->region[0].size = size;
}
rgn->cnt++;

return 0;
Expand Down

0 comments on commit 74b20da

Please sign in to comment.