Skip to content

Commit f8c0689

Browse files
lbernstoneme-no-dev
authored andcommitted
Better cleanup on mount failures, as the idf api now seems to assign handle and mountpoint before failing. Fixes #3265 (#3282)
1 parent a5c873b commit f8c0689

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/FFat/src/FFat.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ bool F_Fat::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles
5858
esp_err_t err = esp_vfs_fat_spiflash_mount(basePath, partitionLabel, &conf, &_wl_handle);
5959
if(err){
6060
log_e("Mounting FFat partition failed! Error: %d", err);
61+
esp_vfs_fat_spiflash_unmount(basePath, _wl_handle);
62+
_wl_handle = WL_INVALID_HANDLE;
6163
return false;
6264
}
6365
_impl->mountpoint(basePath);

0 commit comments

Comments
 (0)