You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2023/01/18 07:40:40 UTC

[nuttx] branch master updated: Fix mmap/fs_mmap.c:259:13: warning: 'mapped' may be used uninitialized in this function [-Wmaybe-uninitialized]

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f8d33e40ac Fix mmap/fs_mmap.c:259:13: warning: 'mapped' may be used uninitialized in this function [-Wmaybe-uninitialized]
f8d33e40ac is described below

commit f8d33e40ac04d42481f00ef2424b97c68123fa8a
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Jan 18 11:17:42 2023 +0800

    Fix mmap/fs_mmap.c:259:13: warning: 'mapped' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 fs/mmap/fs_mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/mmap/fs_mmap.c b/fs/mmap/fs_mmap.c
index 9f08cc2d32..e1e2fe440b 100644
--- a/fs/mmap/fs_mmap.c
+++ b/fs/mmap/fs_mmap.c
@@ -256,7 +256,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
                int fd, off_t offset)
 {
   FAR struct file *filep = NULL;
-  FAR void *mapped;
+  FAR void *mapped = NULL;
   int ret;
 
   if (fd != -1 && fs_getfilep(fd, &filep) < 0)