WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: "keir.fraser" <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] e820: fix e820_change_range_type()
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=BN4MKO4TpbsPw05t8PhoWurcD6nMQinRmj8Ph3Hc7A8=; b=MQxwkx6XAR1d9gKVNESZYJfKWpN8VUxKTMLGaxMoh7E4eD6C8wNUeqdMqzB+1tCF64 XQ8yWlexaeCBGDnBW5vwVebOwyxY+KvHkqpXtao6xKjjUX2TsJEsFhiijrJsS+2GC0/i zn7iOz1bqGQiwHWbT+G1KNpgpgsBjCZ9CD1N8=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] e820: fix e820_change_range_type(), Xiao Guangrong <=