test: Support testing malloc() failures
It is helpful to test that out-of-memory checks work correctly in code
that calls malloc().
Add a simple way to force failure after a given number of malloc() calls.
Fix a header guard to avoid a build error on sandbox_vpl.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
diff --git a/arch/sandbox/include/asm/malloc.h b/arch/sandbox/include/asm/malloc.h
index a1467b5..8aaaa9c 100644
--- a/arch/sandbox/include/asm/malloc.h
+++ b/arch/sandbox/include/asm/malloc.h
@@ -6,6 +6,7 @@
*/
#ifndef __ASM_MALLOC_H
+#define __ASM_MALLOC_H
void *malloc(size_t size);
void free(void *ptr);