diff --git a/rpcs3/Emu/Cell/Modules/cellKb.cpp b/rpcs3/Emu/Cell/Modules/cellKb.cpp index f056c07fb0..a8109e6fff 100644 --- a/rpcs3/Emu/Cell/Modules/cellKb.cpp +++ b/rpcs3/Emu/Cell/Modules/cellKb.cpp @@ -37,13 +37,16 @@ error_code cellKbInit(u32 max_connect) auto& handler = g_fxo->get(); - const auto init = handler.init.init(); + auto init = handler.init.init(); if (!init) return CELL_KB_ERROR_ALREADY_INITIALIZED; if (max_connect == 0 || max_connect > CELL_KB_MAX_KEYBOARDS) + { + init.cancel(); return CELL_KB_ERROR_INVALID_PARAMETER; + } libio_sys_config_init(); handler.Init(std::min(max_connect, 7u)); diff --git a/rpcs3/Emu/Cell/Modules/cellMouse.cpp b/rpcs3/Emu/Cell/Modules/cellMouse.cpp index dcfe32b2d1..7a1f19204a 100644 --- a/rpcs3/Emu/Cell/Modules/cellMouse.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMouse.cpp @@ -38,13 +38,14 @@ error_code cellMouseInit(u32 max_connect) auto& handler = g_fxo->get(); - const auto init = handler.init.init(); + auto init = handler.init.init(); if (!init) return CELL_MOUSE_ERROR_ALREADY_INITIALIZED; if (max_connect == 0 || max_connect > CELL_MAX_MICE) { + init.cancel(); return CELL_MOUSE_ERROR_INVALID_PARAMETER; }