From 74b20dad1c4cc0fd13ceca62fbab808919e1a7ea Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 19 Feb 2008 21:28:18 -0800 Subject: [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 Signed-off-by: David S. Miller --- lib/lmb.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/lmb.c') diff --git a/lib/lmb.c b/lib/lmb.c index e3c8dcb04b4..3c43b95fef4 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) break; } } + + if (base < rgn->region[0].base) { + rgn->region[0].base = base; + rgn->region[0].size = size; + } rgn->cnt++; return 0; -- cgit v1.2.3