cc3200: Prevent multiple memory allocations if sflash init fails.

pull/1157/head
danicampora 2015-03-14 09:52:46 +01:00
rodzic 2ae17def52
commit d432bcb9ac
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -51,6 +51,7 @@ DRESULT sflash_disk_init (void) {
if (!sflash_init_done) {
// Allocate space for the block cache
ASSERT ((sflash_block_cache = mem_Malloc(SFLASH_BLOCK_SIZE)) != NULL);
sflash_init_done = true;
// Proceed to format the memory if not done yet
for (int i = 0; i < SFLASH_BLOCK_COUNT; i++) {
@ -74,7 +75,6 @@ DRESULT sflash_disk_init (void) {
}
sl_LockObjUnlock (&wlan_LockObj);
}
sflash_init_done = true;
sflash_prblock = UINT32_MAX;
sflash_cache_is_dirty = false;
}