From ad9db974cb2ad058a00a2970ccdfc11cfaaa77a3 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Wed, 22 Apr 2020 08:40:05 +0900 Subject: [PATCH] mm: Fix heap corruption in protected build Signed-off-by: Masayuki Ishikawa --- include/nuttx/mm/mm.h | 4 ---- mm/mm_heap/mm_initialize.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/include/nuttx/mm/mm.h b/include/nuttx/mm/mm.h index 4536200ec8..f448138dca 100644 --- a/include/nuttx/mm/mm.h +++ b/include/nuttx/mm/mm.h @@ -211,12 +211,10 @@ struct mm_freenode_s FAR struct mm_freenode_s *blink; }; -#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__) struct mm_delaynode_s { struct mm_delaynode_s *flink; }; -#endif /* What is the size of the freenode? */ @@ -258,11 +256,9 @@ struct mm_heap_s struct mm_freenode_s mm_nodelist[MM_NNODES]; -#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__) /* Free delay list, for some situation can't do free immdiately */ struct mm_delaynode_s *mm_delaylist; -#endif }; /**************************************************************************** diff --git a/mm/mm_heap/mm_initialize.c b/mm/mm_heap/mm_initialize.c index d96b7b16b9..fa41069b2f 100644 --- a/mm/mm_heap/mm_initialize.c +++ b/mm/mm_heap/mm_initialize.c @@ -175,11 +175,9 @@ void mm_initialize(FAR struct mm_heap_s *heap, FAR void *heapstart, heap->mm_nregions = 0; #endif -#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__) /* Initialize mm_delaylist */ heap->mm_delaylist = NULL; -#endif /* Initialize the node array */