]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-event: Use correct allocator for vfscore_file
authorMarco Schlumpp <marco@unikraft.io>
Wed, 26 Jul 2023 10:43:25 +0000 (12:43 +0200)
committerUnikraft <monkey@unikraft.io>
Mon, 7 Aug 2023 14:20:14 +0000 (14:20 +0000)
Same reasoning as in the previous commit.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Tu Dinh Ngoc <dinhngoc.tu@irit.fr>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1000

lib/posix-event/epoll.c
lib/posix-event/eventfd.c

index 6a7b57add4e6e7128dc19eb799fb0df814fc2e71..707ca91e0cc701c958606256518d1984edfbafc8 100644 (file)
@@ -130,7 +130,7 @@ static int do_epoll_create(struct uk_alloc *a, int flags)
                goto ERR_MALLOC_FILE;
        }
 
-       vfs_file = uk_malloc(a, sizeof(struct vfscore_file));
+       vfs_file = malloc(sizeof(struct vfscore_file));
        if (unlikely(!vfs_file)) {
                ret = -ENOMEM;
                goto ERR_MALLOC_VFS_FILE;
@@ -185,7 +185,7 @@ ERR_VFS_INSTALL:
 ERR_ALLOC_DENTRY:
        vput(vfs_vnode);
 ERR_ALLOC_VNODE:
-       uk_free(a, vfs_file);
+       free(vfs_file);
 ERR_MALLOC_VFS_FILE:
        uk_free(a, ep);
 ERR_MALLOC_FILE:
index ab1e324d68e3feecd49cb5b25df6fb7625361fb4..d8c911b4959b7c87e5ada7d49d7660e52de4935c 100644 (file)
@@ -364,7 +364,7 @@ static int do_eventfd(struct uk_alloc *a, unsigned int initval, int flags)
                goto ERR_MALLOC_FILE;
        }
 
-       vfs_file = uk_malloc(a, sizeof(struct vfscore_file));
+       vfs_file = malloc(sizeof(struct vfscore_file));
        if (unlikely(!vfs_file)) {
                ret = -ENOMEM;
                goto ERR_MALLOC_VFS_FILE;
@@ -427,7 +427,7 @@ ERR_VFS_INSTALL:
 ERR_ALLOC_DENTRY:
        vput(vfs_vnode);
 ERR_ALLOC_VNODE:
-       uk_free(a, vfs_file);
+       free(vfs_file);
 ERR_MALLOC_VFS_FILE:
        uk_free(a, efd);
 ERR_MALLOC_FILE: