Skip to contentSkip to conversation

e820: fix e820_change_range_type()

PATCH New Xiao Guangrong 1 participant 1 message Nov 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e820: fix e820_change_range_type()

In below case, e820_change_range_type() will return succee:
[s, e] is in the middle of [rs, re] and e820->nr_map+1 >= ARRAY_SIZE(e820->map) actually, it's failed, so this patch fix it

xen/arch/x86/e820.c +1 -1
diff -r f23b859e237a -r 93bc06dd1161 xen/arch/x86/e820.c
@@ -574,7 +574,7 @@
             e820->map[i+1].type = new_type;
         }
     }
-    else if ( e820->nr_map+1 < ARRAY_SIZE(e820->map) )
+    else
     {
         if ( (e820->nr_map + 2) > ARRAY_SIZE(e820->map) )
             goto overflow;