sandbox: memblock: abort on unsatisfiable alloc request
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <socks/memblock.h>
|
#include <socks/memblock.h>
|
||||||
|
|
||||||
@@ -225,7 +226,8 @@ static phys_addr_t do_alloc(size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (allocated_base == ADDR_MAX) {
|
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);
|
int status = memblock_add_range(&memblock.reserved, allocated_base, size, MEMBLOCK_ALLOC);
|
||||||
|
|||||||
Reference in New Issue
Block a user