diff options
| author | Jeff Epler <jepler@gmail.com> | 2019-12-10 15:11:10 -0600 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2019-12-10 17:06:09 -0600 |
| commit | b22fbcd77da8c9724ed08228b89cfea53afdd5b6 (patch) | |
| tree | 0ce35fe4b074a9d7b953aca4dc944ea20bfb3299 /supervisor | |
| parent | 024ba978ec909d39d411a74b443d2ffa20250fa6 (diff) | |
supervisor: external_flash: don't call m_malloc_maybe when it's bad
Diffstat (limited to 'supervisor')
| -rw-r--r-- | supervisor/shared/external_flash/external_flash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 99df553e1..e7d86240b 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -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; |
