Skip to content

Commit b22fbcd

Browse files
committed
supervisor: external_flash: don't call m_malloc_maybe when it's bad
1 parent 024ba97 commit b22fbcd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

supervisor/shared/external_flash/external_flash.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ static bool allocate_ram_cache(void) {
324324
return true;
325325
}
326326

327+
if (MP_STATE_MEM(gc_pool_start) == 0) {
328+
return false;
329+
}
330+
327331
MP_STATE_VM(flash_ram_cache) = m_malloc_maybe(blocks_per_sector * pages_per_block * sizeof(uint32_t), false);
328332
if (MP_STATE_VM(flash_ram_cache) == NULL) {
329333
return false;

0 commit comments

Comments
 (0)