diff --git a/storage/filesystem/fat/source/FATFileSystem.cpp b/storage/filesystem/fat/source/FATFileSystem.cpp index 9fefb0222f..3285d1a4ba 100644 --- a/storage/filesystem/fat/source/FATFileSystem.cpp +++ b/storage/filesystem/fat/source/FATFileSystem.cpp @@ -330,6 +330,11 @@ int FATFileSystem::unmount() } FRESULT res = f_mount(NULL, _fsid, 0); + int err = _ffs[_id]->deinit(); + if (err) { + unlock(); + return err; + } _ffs[_id] = NULL; _id = -1; unlock();