nuttx/fs/mqueue
dongjiuzhu1 1b6733c056 fs/mqueue: fix inverted 'created' flag in file_mq_vopen
The 'created' flag values were incorrectly inverted in file_mq_vopen():

1. When opening an existing message queue (inode_find succeeds):
   - Before: incorrectly set *created = 1 (indicating new creation)
   - After: correctly set *created = 0 (indicating existing queue)

2. When creating a new message queue (inode_find fails):
   - Before: incorrectly set *created = 0 (indicating existing queue)
   - After: correctly set *created = 1 (indicating new creation)

This bug could lead to incorrect resource management and cleanup behavior
in the calling function nxmq_vopen() when file_allocate() returns an error,
as it relies on the 'created' flag to determine whether the message queue
was newly created and needs to be cleaned up.

Impact:
- Resource leak when opening existing queues that should not be released
- Missing cleanup when creating new queues that should be released on error

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-31 02:27:37 +08:00
..
CMakeLists.txt fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
Kconfig mqueue: Rename FS_MQUEUE_MPATH to FS_MQUEUE_VFS_PATH 2022-02-05 23:58:01 +01:00
Make.defs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
mq_close.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
mq_open.c fs/mqueue: fix inverted 'created' flag in file_mq_vopen 2025-12-31 02:27:37 +08:00
mq_unlink.c bugfix:the inode may have been removed by other core in SMP 2025-12-16 16:02:46 -03:00
mqueue.h fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00