aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-02-20 00:28:18 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-20 00:28:18 -0500
commit74b20dad1c4cc0fd13ceca62fbab808919e1a7ea (patch)
tree50c6d5e350030bbea5d6be159fbc3e6af92188e5
parente5f270954364a4add74e8445b1db925ac534fcfb (diff)
[LMB]: Fix lmb_add_region if region should be added at the head
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>
-rw-r--r--lib/lmb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/lmb.c b/lib/lmb.c
index e3c8dcb04b46..3c43b95fef4a 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -184,6 +184,11 @@ static long __init lmb_add_region(struct lmb_region *rgn, u64 base, u64 size)
184 break; 184 break;
185 } 185 }
186 } 186 }
187
188 if (base < rgn->region[0].base) {
189 rgn->region[0].base = base;
190 rgn->region[0].size = size;
191 }
187 rgn->cnt++; 192 rgn->cnt++;
188 193
189 return 0; 194 return 0;