fs/mmap: enable parameter checks always

These parameter checks should always be enabled.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu 2024-03-25 16:06:35 +08:00 committed by Xiang Xiao
parent 56b125bb82
commit a5b5c963c7

View File

@ -73,7 +73,6 @@ static int file_mmap_(FAR struct file *filep, FAR void *start,
* things. * things.
*/ */
#ifdef CONFIG_DEBUG_FEATURES
/* A flags with MAP_PRIVATE and MAP_SHARED is invalid. */ /* A flags with MAP_PRIVATE and MAP_SHARED is invalid. */
if ((flags & MAP_PRIVATE) && (flags & MAP_SHARED)) if ((flags & MAP_PRIVATE) && (flags & MAP_SHARED))
@ -99,7 +98,6 @@ static int file_mmap_(FAR struct file *filep, FAR void *start,
ferr("ERROR: Invalid length, length=%zu\n", length); ferr("ERROR: Invalid length, length=%zu\n", length);
return -EINVAL; return -EINVAL;
} }
#endif /* CONFIG_DEBUG_FEATURES */
/* Check if we are just be asked to allocate memory, i.e., MAP_ANONYMOUS /* Check if we are just be asked to allocate memory, i.e., MAP_ANONYMOUS
* set meaning that the memory is not backed up from a file. The file * set meaning that the memory is not backed up from a file. The file