fs/mmap: fix compile warning if set the optimize level to O3

| $ gcc -c "-O3" -Wall -isystem include -D__NuttX__ -D__KERNEL__ -I fs -I sched fs/mmap/fs_mmap.c -o fs_mmap.o
| include/sys/mman.h: In function ‘mmap’:
| fs/mmap/fs_mmap.c:259:13: warning: ‘mapped’ may be used uninitialized in this function [-Wmaybe-uninitialized]
|   259 |   FAR void *mapped;
|       |             ^~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-01-17 17:09:55 +08:00 committed by Xiang Xiao
parent c0aaaa94e1
commit 3d7629a02c
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ static int file_mmap_(FAR struct file *filep, FAR void *start,
/* Return */
out:
if (ret == OK)
if (ret >= OK)
{
*mapped = entry.vaddr;
}