From 885ed7d765e81572f8ded8116c5b38d6f8371f84 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 29 Jan 2023 11:15:43 +0000 Subject: [PATCH] sandbox: memblock: abort on unsatisfiable alloc request --- sandbox/memblock/memblock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sandbox/memblock/memblock.c b/sandbox/memblock/memblock.c index 5065ec5..3d045c6 100644 --- a/sandbox/memblock/memblock.c +++ b/sandbox/memblock/memblock.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -225,7 +226,8 @@ static phys_addr_t do_alloc(size_t size) } if (allocated_base == ADDR_MAX) { - return 0; + fprintf(stderr, "memblock: cannot allocate %zu byte buffer!\n", size); + abort(); } int status = memblock_add_range(&memblock.reserved, allocated_base, size, MEMBLOCK_ALLOC);