Skip to content

Commit

Permalink
Change recovery_handler error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryOderNichts committed Jun 13, 2022
1 parent e6a6e5e commit bfd0798
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arm_kernel/source/recovery_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ int load_recovery(void)

res = FSA_Mount(fsaHandle, "/dev/sdcard01", "/vol/storage_udpihsd", 2, NULL, 0);
if (res < 0) {
goto error;
IOS_Close(fsaHandle);
return res;
}

res = FSA_OpenFile(fsaHandle, "/vol/storage_udpihsd/recovery_menu", "rb", &fileHandle);
if (res < 0) {
goto error;
FSA_Unmount(fsaHandle, "/vol/storage_udpihsd", 2);
IOS_Close(fsaHandle);
return res;
}

readBuffer = IOS_HeapAllocAligned(0xcaff, READ_BUFFER_SIZE, 0x40);
Expand Down Expand Up @@ -136,5 +139,5 @@ error: ;
((void (*)(const char*)) header.entry)("udpih");
}

return (res >= 0) ? 0 : res;
return res;
}

0 comments on commit bfd0798

Please sign in to comment.