diff --git a/src/core/libraries/kernel/libkernel.cpp b/src/core/libraries/kernel/libkernel.cpp index f21a0f3dd..8b26ab664 100644 --- a/src/core/libraries/kernel/libkernel.cpp +++ b/src/core/libraries/kernel/libkernel.cpp @@ -178,6 +178,9 @@ s32 PS4_SYSV_ABI sceKernelLoadStartModule(const char* moduleFileName, size_t arg // Load PRX module and relocate any modules that import it. auto* linker = Common::Singleton::Instance(); u32 handle = linker->LoadModule(path); + if (handle == -1) { + return ORBIS_KERNEL_ERROR_EINVAL; + } auto* module = linker->GetModule(handle); linker->RelocateAnyImports(module);