[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] e820: fix e820_change_range_type()


  • To: "keir.fraser" <keir.fraser@xxxxxxxxxxxxx>
  • From: Xiao Guangrong <ericxiao.gr@xxxxxxxxx>
  • Date: Tue, 10 Nov 2009 03:19:44 +0800
  • Cc: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 09 Nov 2009 11:20:21 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=eR7OewWebG/pTsXL3+GRJydNaKA2RQmAnjy9qlyvb/Wn1W3smz5ORXSz3BMCSx6JaF LjO3vwO292AWQBO/zcDXsdjMnWx9gGVdRwYZgeTSjrLTb6d8h9ZE8wQVrW+g2mzF2ZVs 0lSHuoM+hNyloLBNj7Eo0BAm8hFV73+FAgp1U=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

Signed-off-by: Xiao Guangrong <ericxiao.gr@xxxxxxxxx>

diff -r f23b859e237a -r 93bc06dd1161 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c       Tue Nov 10 02:34:16 2009 +0800
+++ b/xen/arch/x86/e820.c       Tue Nov 10 02:41:59 2009 +0800
@@ -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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.