This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6c27903685d mm/mempool: Fix interrupt pool backtrace walk
6c27903685d is described below
commit 6c27903685d2bb8e8b51daeda2604aebb4d81493
Author: chao an <[email protected]>
AuthorDate: Wed Oct 28 14:46:33 2026 +0800
mm/mempool: Fix interrupt pool backtrace walk
The interrupt pool backtrace iterator cast the pool base before adding byte
offsets, so pointer arithmetic was scaled by the backtrace structure size.
Keep the arithmetic byte-based so the iterator visits the metadata stored
after each block.
Signed-off-by: chao an <[email protected]>
---
mm/mempool/mempool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/mempool/mempool.c b/mm/mempool/mempool.c
index 54ebb099b28..a2c36a3adc0 100644
--- a/mm/mempool/mempool.c
+++ b/mm/mempool/mempool.c
@@ -114,6 +114,7 @@ static inline void mempool_add_backtrace(FAR struct
mempool_s *pool,
int result = sched_backtrace(buf->pid, buf->backtrace,
CONFIG_MM_BACKTRACE,
CONFIG_MM_HEAP_MEMPOOL_BACKTRACE_SKIP);
+
if (result < CONFIG_MM_BACKTRACE)
{
buf->backtrace[result] = NULL;
@@ -142,7 +143,7 @@ static void mempool_foreach(FAR struct mempool_s *pool,
while (nblks--)
{
buf = (FAR struct mempool_backtrace_s *)
- pool->ibase + nblks * blocksize + pool->blocksize;
+ (pool->ibase + nblks * blocksize + pool->blocksize);
callback(pool, buf, input, output);
}