21 Feb
2018
21 Feb
'18
6:26 p.m.
Add a sanity check to make sure that data/rodata contains expected values otherwise this can cause unpredictable behaviour that is difficult to later diagnose.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/lib/alloc.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/lib/alloc.c b/src/lib/alloc.c index 847cb93..1ae0c91 100644 --- a/src/lib/alloc.c +++ b/src/lib/alloc.c @@ -646,6 +646,10 @@ void init_heap(struct reef *reef) struct block_map *current_map; int i;
+ /* sanity check for malformed images or loader issues */ + if (memmap.system.heap != HEAP_SYSTEM_BASE) + panic(PANIC_MEM); + spinlock_init(&memmap.lock);
/* initialise buffer map */
--
2.14.1