diff options
author | danicampora <danicampora@gmail.com> | 2015-03-14 09:52:46 +0100 |
---|---|---|
committer | danicampora <danicampora@gmail.com> | 2015-03-14 10:08:46 +0100 |
commit | d432bcb9acb7105274c10c6b4bee3736a1a690b5 (patch) | |
tree | 619f2f1cc0d85fe4e1e2d6c195219ebacc101d47 | |
parent | 2ae17def5293452efe255df2b104e0bf2b04f56f (diff) |
cc3200: Prevent multiple memory allocations if sflash init fails.
-rw-r--r-- | cc3200/fatfs/src/drivers/sflash_diskio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cc3200/fatfs/src/drivers/sflash_diskio.c b/cc3200/fatfs/src/drivers/sflash_diskio.c index f46337679..28fb6f907 100644 --- a/cc3200/fatfs/src/drivers/sflash_diskio.c +++ b/cc3200/fatfs/src/drivers/sflash_diskio.c @@ -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; } |