Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
d432bcb9
Commit
d432bcb9
authored
Mar 14, 2015
by
danicampora
Browse files
cc3200: Prevent multiple memory allocations if sflash init fails.
parent
2ae17def
Changes
1
Hide whitespace changes
Inline
Side-by-side
cc3200/fatfs/src/drivers/sflash_diskio.c
View file @
d432bcb9
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment