summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--samples/acrn/vm-sample.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/samples/acrn/vm-sample.c b/samples/acrn/vm-sample.c
index 7abd68b20153..704402c64ea3 100644
--- a/samples/acrn/vm-sample.c
+++ b/samples/acrn/vm-sample.c
@@ -13,7 +13,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <malloc.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
@@ -54,8 +53,8 @@ int main(int argc, char **argv)
argc = argc;
argv = argv;
- guest_memory = memalign(4096, GUEST_MEMORY_SIZE);
- if (!guest_memory) {
+ ret = posix_memalign(&guest_memory, 4096, GUEST_MEMORY_SIZE);
+ if (ret < 0) {
printf("No enough memory!\n");
return -1;
}