pkarashchenko commented on code in PR #8194:
URL: https://github.com/apache/nuttx/pull/8194#discussion_r1082239504


##########
fs/inode/fs_files.c:
##########
@@ -298,7 +301,10 @@ int files_duplist(FAR struct filelist *plist, FAR struct 
filelist *clist)
 #endif
 
           filep = &plist->fl_files[i][j];
-          if (filep->f_inode == NULL || (filep->f_oflags & O_CLOEXEC) != 0)
+          DEBUGASSERT(filep);
+
+          if (filep && (filep->f_inode == NULL ||
+                       (filep->f_oflags & O_CLOEXEC) != 0))

Review Comment:
   I do not understand this. Why do we need `DEBUGASSERT(filep);` and `if 
(filep`? I would expect code to be
   ```suggestion
             DEBUGASSERT(filep);
   
             if (filep->f_inode == NULL ||
                 (filep->f_oflags & O_CLOEXEC) != 0)
   ```



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

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

Reply via email to