threadx
threadx copied to clipboard
Incorrect constant used in comparison.
https://github.com/eclipse-threadx/threadx/blob/7ad78c40e9702917264a9b722890110fdb909ebc/ports/cortex_m4/iar/src/tx_iar.c#L289
Should be comparing with _MAX_FLOCK, not _MAX_LOCK.
Result of bug:
When _MAX_FLOCK is greater than _MAX_LOCK, some file mutexes are incorrectly set to NULL, and the app will hard fault as soon as the file lock is encountered.