Skip to content

Commit

Permalink
x86/xen: panic on bad Xen-provided memory map
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Kelly authored and David Vrabel committed Oct 23, 2014
1 parent 3251f20 commit 1ea644c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ea644c

Please sign in to comment.