mirror of
https://github.com/apache/nuttx.git
synced 2026-08-02 04:38:59 +00:00
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> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Make.defs | ||
| mq_close.c | ||
| mq_open.c | ||
| mq_unlink.c | ||
| mqueue.h | ||