You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/16 02:47:53 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3070: fs/mmap: Return EACCES for incompatible file descriptors

xiaoxiang781216 commented on a change in pull request #3070:
URL: https://github.com/apache/incubator-nuttx/pull/3070#discussion_r594823722



##########
File path: fs/mmap/fs_mmap.c
##########
@@ -142,6 +148,30 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
     }
 #endif
 
+  if (fs_getfilep(fd, &filep) < 0)

Review comment:
       ```suggestion
     ret = fs_getfilep(fd, &filep);
     if (ret < 0)
       {
         ferr("ERROR: Invalid file descriptor, fd=%d\n", fd);
         goto errout;
       }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org