diff --git a/fs/mmap/fs_munmap.c b/fs/mmap/fs_munmap.c index 9ef45f44142..6badbc0f29f 100644 --- a/fs/mmap/fs_munmap.c +++ b/fs/mmap/fs_munmap.c @@ -119,9 +119,9 @@ static int file_munmap_(FAR void *start, size_t length, bool kernel) /* Then free the region */ - if (curr->kernel) + if (kernel) { - kmm_free(curr) + kmm_free(curr); } else { diff --git a/fs/mmap/fs_rammap.c b/fs/mmap/fs_rammap.c index 30f5d610a96..222a70e3c6f 100644 --- a/fs/mmap/fs_rammap.c +++ b/fs/mmap/fs_rammap.c @@ -106,8 +106,8 @@ int rammap(FAR struct file *filep, size_t length, /* Allocate a region of memory of the specified size */ - alloc = (FAR uint8_t *)kernel ? - kmm_malloc(sizeof(struct fs_rammap_s) + length); + alloc = kernel ? + kmm_malloc(sizeof(struct fs_rammap_s) + length) : kumm_malloc(sizeof(struct fs_rammap_s) + length); if (!alloc) {