fs/mmap/fs_munmap.c: return error if len is 0
munmap() shall return ERROR with errno = EINVAL if len is 0 Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
parent
3f55710184
commit
7439e49db8
1 changed files with 5 additions and 0 deletions
|
|
@ -55,6 +55,11 @@ static int file_munmap_(FAR void *start, size_t length,
|
|||
FAR struct mm_map_s *mm = get_current_mm();
|
||||
int ret = OK;
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Iterate through all the mappings and call the underlying
|
||||
* unmap for every mapping where "start" lies
|
||||
* break loop on any errors.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue