diff --git a/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp index 5b63db0e87..e07ad8cf56 100644 --- a/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp @@ -936,7 +936,10 @@ int SPIFBlockDevice::_reset_flash_mem() tr_error("Sending RST failed"); status = -1; } - _is_mem_ready(); + if (false == _is_mem_ready()) { + tr_error("Device not ready, write failed"); + status = -1; + } } } diff --git a/features/storage/filesystem/fat/ChaN/ff.cpp b/features/storage/filesystem/fat/ChaN/ff.cpp index e98bb3e43c..672291ee87 100644 --- a/features/storage/filesystem/fat/ChaN/ff.cpp +++ b/features/storage/filesystem/fat/ChaN/ff.cpp @@ -2719,7 +2719,7 @@ void get_fileinfo ( if (wc == 0) { di = 0; break; } /* Buffer overflow? */ di += wc; #else /* ANSI/OEM output */ - if (di <= FF_SFN_BUF) fno->altname[di++] = (TCHAR)wc; /* Store it without any conversion */ + if (di < FF_SFN_BUF) fno->altname[di++] = (TCHAR)wc; /* Store it without any conversion */ #endif } fno->altname[di] = 0; /* Terminate the SFN (null string means SFN is invalid) */ diff --git a/features/storage/filesystem/littlefs/littlefs/lfs.c b/features/storage/filesystem/littlefs/littlefs/lfs.c index 477addb124..33987e5e7d 100644 --- a/features/storage/filesystem/littlefs/littlefs/lfs.c +++ b/features/storage/filesystem/littlefs/littlefs/lfs.c @@ -2481,7 +2481,7 @@ int lfs_deorphan(lfs_t *lfs) { } lfs_dir_t pdir = {.d.size = 0x80000000}; - lfs_dir_t cwd = {.d.tail[0] = 0, .d.tail[1] = 1}; + lfs_dir_t cwd = {.d.tail = {0,1}}; // iterate over all directory directory entries while (!lfs_pairisnull(cwd.d.tail)) {