stm32/factoryreset: Init vfs flags before calling pyb_flash_init_vfs.

The vfs flags could have any random value from stack.  This bug was
introduced back in 7723dac337
This commit is contained in:
iabdalkader 2021-12-18 19:11:47 +02:00 committed by Damien George
parent fe9ffff9c0
commit f9e5b0d93d
1 changed files with 1 additions and 0 deletions

View File

@ -109,6 +109,7 @@ MP_WEAK int factory_reset_create_filesystem(void) {
uint32_t start_tick = HAL_GetTick();
fs_user_mount_t vfs;
vfs.blockdev.flags = 0;
pyb_flash_init_vfs(&vfs);
uint8_t working_buf[FF_MAX_SS];
FRESULT res = f_mkfs(&vfs.fatfs, FM_FAT, 0, working_buf, sizeof(working_buf));