pussuw commented on code in PR #16499:
URL: https://github.com/apache/nuttx/pull/16499#discussion_r2135681590


##########
fs/inode/fs_files.c:
##########
@@ -177,38 +148,97 @@ static int files_extend(FAR struct filelist *list, size_t 
row)
 
       for (j = orig_rows; j < i; j++)
         {
-          fs_heap_free(files[j]);
+          fs_heap_free(fds[j]);
         }
 
-      fs_heap_free(files);
+      fs_heap_free(fds);
 
       return OK;
     }
 
-  if (list->fl_files != NULL)
+  if (list->fl_fds != NULL)
     {
-      memcpy(files, list->fl_files,
-             list->fl_rows * sizeof(FAR struct file *));
+      memcpy(fds, list->fl_fds, list->fl_rows * sizeof(FAR struct fd *));
     }
 
-  tmp = list->fl_files;
-  list->fl_files = files;
+  tmp = list->fl_fds;
+  list->fl_fds = fds;
   list->fl_rows = row;
 
   spin_unlock_irqrestore_notrace(&list->fl_lock, flags);
 
-  if (tmp != NULL && tmp != &list->fl_prefile)
+  if (tmp != NULL && tmp != &list->fl_prefd)
     {
       fs_heap_free(tmp);
     }
 
   return OK;
 }
 
+/****************************************************************************
+ * Name: fdlist_uninstall
+ ****************************************************************************/
+
+static void fdlist_uninstall(FAR struct fdlist *list, FAR struct fd *fdp)
+{
+  FAR struct file *filep = NULL;
+  irqstate_t flags;
+
+  flags = spin_lock_irqsave_notrace(&list->fl_lock);
+
+  /* There is a race condition here: someone might have freed and installed

Review Comment:
   After your change, this comment is bogus I believe



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