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 <ville.juven@unikie.com>
This commit is contained in:
Ville Juven 2025-05-12 18:03:38 +03:00 committed by Xiang Xiao
parent c37a270cda
commit 3fe1d1a54d

View file

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