All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e820: fix clip_to_limit()
@ 2009-11-09 20:04 Xiao Guangrong
  2009-11-09 20:46 ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Xiao Guangrong @ 2009-11-09 20:04 UTC (permalink / raw)
  To: keir.fraser; +Cc: Xiao Guangrong, xen-devel

In clip_to_limit(), after memmove(&e820.map[i], &e820.map[i+1], ...), the original
e820.map[i+1] become current e820.map[i] but the next loop count is i+1, so the original
e820.map[i+1] will be skipped

Actually, e820 is sorted form low to high by sanitize_e820_map(), so we can simply break
the loop if we meet the item which overrun "limit"

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

diff -r 93bc06dd1161 -r 5e06f2790d93 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c	Tue Nov 10 02:41:59 2009 +0800
+++ b/xen/arch/x86/e820.c	Tue Nov 10 03:51:08 2009 +0800
@@ -389,6 +389,7 @@
                      (e820.nr_map - i - 1) * sizeof(struct e820entry));
              e820.nr_map--;
          }
+	break;
      }

      if ( old_limit )

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-10  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09 20:04 [PATCH] e820: fix clip_to_limit() Xiao Guangrong
2009-11-09 20:46 ` Keir Fraser
2009-11-10  2:13   ` Xiao Guangrong
2009-11-10  7:45     ` Keir Fraser
2009-11-10  8:19       ` Xiao Guangrong
2009-11-10  8:39         ` Keir Fraser
2009-11-10  9:18           ` 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.