supervisor: external_flash: don't call m_malloc_maybe when it's bad

This commit is contained in:
Jeff Epler 2019-12-10 15:11:10 -06:00
parent 024ba978ec
commit b22fbcd77d
1 changed files with 4 additions and 0 deletions

View File

@ -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;