xiaoxiang781216 commented on code in PR #13132:
URL: https://github.com/apache/nuttx/pull/13132#discussion_r1730009148
##########
fs/procfs/fs_procfs.c:
##########
@@ -627,12 +636,18 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR
const char *relpath,
if (!relpath || relpath[0] == '\0')
{
+ size_t num = 0;
+
/* The path refers to the top level directory. Allocate the level0
* dirent structure.
*/
+#ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS
+ nxsched_foreach(procfs_thread_number, &num);
+#endif
+
level0 = (FAR struct procfs_level0_s *)
- kmm_zalloc(sizeof(struct procfs_level0_s));
+ kmm_zalloc(sizeof(struct procfs_level0_s) + sizeof(pid_t) * num) ;
Review Comment:
g_npidhash may large than the real number of thread
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]