All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e820: fix e820_change_range_type()
@ 2009-11-09 19:19 Xiao Guangrong
  0 siblings, 0 replies; only message in thread
From: Xiao Guangrong @ 2009-11-09 19:19 UTC (permalink / raw)
  To: keir.fraser; +Cc: Xiao Guangrong, xen-devel

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@gmail.com>

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-09 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09 19:19 [PATCH] e820: fix e820_change_range_type() Xiao Guangrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.