2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

kernel: svc: Add missing error check to CancelSynchronization.

- Avoids a potential crash if the handle is invalid, and also makes this code accurate to real kernel behavior.
This commit is contained in:
bunnei 2021-06-09 15:24:46 -07:00
parent 5857067a18
commit c63ea608aa

View file

@ -449,8 +449,8 @@ static ResultCode CancelSynchronization(Core::System& system, Handle handle) {
// Get the thread from its handle.
KScopedAutoObject thread =
system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(
static_cast<Handle>(handle));
system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(handle);
R_UNLESS(thread.IsNotNull(), ResultInvalidHandle);
// Cancel the thread's wait.
thread->WaitCancel();