mirror of
https://github.com/apache/nuttx.git
synced 2026-03-24 23:54:24 +08:00
Some checks failed
Build Documentation / build-html (push) Has been cancelled
idr_destroy() would loop over the removed and alloced RB tree nodes freeing them but not removing them from the trees. From the perspective of the RB tree those nodes would remain valid, while in fact, they were free memory, potentially reallocated for other purposes, or otherwise overwritten by the allocator with metadata. This would cause (seemingly random) memory corruption crashes triggered by the RB tree code trying to access link fields from the free'd nodes. Fix that by removing the nodes before freeing them. Signed-off-by: George Poulios <gpoulios@census-labs.com>