Skip to content

Commit

Permalink
supervisor: external_flash: don't call m_malloc_maybe when it's bad
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Dec 10, 2019
1 parent 024ba97 commit b22fbcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions supervisor/shared/external_flash/external_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ static bool allocate_ram_cache(void) {
return true;
}

if (MP_STATE_MEM(gc_pool_start) == 0) {
return false;
}

MP_STATE_VM(flash_ram_cache) = m_malloc_maybe(blocks_per_sector * pages_per_block * sizeof(uint32_t), false);
if (MP_STATE_VM(flash_ram_cache) == NULL) {
return false;
Expand Down

0 comments on commit b22fbcd

Please sign in to comment.