From 11ef71d9748c09dce00925b249f5aba5c806dab5 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Mon, 12 May 2025 18:03:38 +0300 Subject: [PATCH] fs/pseudofs: Add missing bumping of inode refcount When a new pseudofile is created, the inode reference count needs to be bumped to protect the node. Signed-off-by: Ville Juven --- fs/vfs/fs_pseudofile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/vfs/fs_pseudofile.c b/fs/vfs/fs_pseudofile.c index df896a50785..a6fadb02c20 100644 --- a/fs/vfs/fs_pseudofile.c +++ b/fs/vfs/fs_pseudofile.c @@ -493,6 +493,7 @@ int pseudofile_create(FAR struct inode **node, FAR const char *path, (*node)->i_flags = 1; (*node)->u.i_ops = &g_pseudofile_ops; (*node)->i_private = pf; + atomic_fetch_add(&(*node)->i_crefs, 1); inode_unlock(); #ifdef CONFIG_FS_NOTIFY