From 2702e3cb77c43f31af92a5768f8d83042431ca53 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 4 May 2024 22:06:16 +0200 Subject: [PATCH] ios_mcp: Unmount the sd card when loading a file failed --- source/ios_mcp/source/mcp_loadfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ios_mcp/source/mcp_loadfile.c b/source/ios_mcp/source/mcp_loadfile.c index 6e4b1d4..053aef2 100644 --- a/source/ios_mcp/source/mcp_loadfile.c +++ b/source/ios_mcp/source/mcp_loadfile.c @@ -179,8 +179,8 @@ MCP_LoadCustomFile(int target, char *path, uint32_t filesize, uint32_t fileoffse } } - // Unmount the sd card once the whole file has been read. - if (result >= 0 && result < 0x400000) { + // Unmount the sd card once the whole file has been read or there was an error + if ((result >= 0 && result < 0x400000) || result < 0) { if (target == LOAD_RPX_TARGET_SD_CARD) { int fsa_h = svcOpen("/dev/fsa", 0); FSA_Unmount(fsa_h, mountpath, 0x80000002);