summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMartin Kelly <martin@martingkelly.com>2014-10-16 20:48:11 -0700
committerDavid Vrabel <david.vrabel@citrix.com>2014-10-23 16:24:02 +0100
commit1ea644c8f93f3435760d8b88c25d56475d8b7778 (patch)
tree000d6b70443cc643dd3cb6facba4bca6b767db4c /arch/x86
parent3251f20b897f955ab7f153181b4ebfbb2317cbb9 (diff)
downloadlinux-1ea644c8f93f3435760d8b88c25d56475d8b7778.tar.bz2
x86/xen: panic on bad Xen-provided memory map
Panic if Xen provides a memory map with 0 entries. Although this is unlikely, it is better to catch the error at the point of seeing the map than later on as a symptom of some other crash. Signed-off-by: Martin Kelly <martkell@amazon.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/xen/setup.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index af7216128d93..29834b3fd87f 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -595,6 +595,7 @@ char * __init xen_memory_setup(void)
rc = 0;
}
BUG_ON(rc);
+ BUG_ON(memmap.nr_entries == 0);
/*
* Xen won't allow a 1:1 mapping to be created to UNUSABLE