Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mm/mm_heap/mm_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
uintptr_t heapend;
#if CONFIG_MM_REGIONS > 1
int IDX = heap->mm_nregions;

/* Writing past CONFIG_MM_REGIONS would have catastrophic consequences */
DEBUGASSERT(IDX < CONFIG_MM_REGIONS);
Copy link
Copy Markdown
Contributor

@patacongo patacongo Mar 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding standard requires a blank line after each comment. tools/nxstyle should have caught this.

I will go ahead with the merge and correct that.

if (IDX >= CONFIG_MM_REGIONS)
{
return;
}
#else
# define IDX 0
#endif
Expand Down