Skip to content

Commit

Permalink
FATStorage: make sure to always properly unmount the volume (fixes ev…
Browse files Browse the repository at this point in the history
…il bug)
  • Loading branch information
Arisotura committed Apr 12, 2024
1 parent 111dc7a commit d99c571
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/FATStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ bool FATStorage::InjectFile(const std::string& path, u8* data, u32 len)
res = f_mount(&fs, "0:", 1);
if (res != FR_OK)
{
f_unmount("0:");
ff_disk_close();
return false;
}
Expand Down Expand Up @@ -146,6 +147,7 @@ u32 FATStorage::ReadFile(const std::string& path, u32 start, u32 len, u8* data)
res = f_mount(&fs, "0:", 1);
if (res != FR_OK)
{
f_unmount("0:");
ff_disk_close();
return false;
}
Expand Down Expand Up @@ -1144,6 +1146,7 @@ bool FATStorage::Save()
res = f_mount(&fs, "0:", 1);
if (res != FR_OK)
{
f_unmount("0:");
ff_disk_close();
return false;
}
Expand Down

0 comments on commit d99c571

Please sign in to comment.