mm: Fix heap corruption in protected build
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
diff --git a/include/nuttx/mm/mm.h b/include/nuttx/mm/mm.h
index 4536200..f448138 100644
--- a/include/nuttx/mm/mm.h
+++ b/include/nuttx/mm/mm.h
@@ -211,12 +211,10 @@
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_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 d96b7b1..fa41069 100644
--- a/mm/mm_heap/mm_initialize.c
+++ b/mm/mm_heap/mm_initialize.c
@@ -175,11 +175,9 @@
heap->mm_nregions = 0;
#endif
-#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
/* Initialize mm_delaylist */
heap->mm_delaylist = NULL;
-#endif
/* Initialize the node array */