mirror of https://git.suyu.dev/suyu/suyu
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:
parent
5857067a18
commit
c63ea608aa
|
@ -449,8 +449,8 @@ static ResultCode CancelSynchronization(Core::System& system, Handle handle) {
|
||||||
|
|
||||||
// Get the thread from its handle.
|
// Get the thread from its handle.
|
||||||
KScopedAutoObject thread =
|
KScopedAutoObject thread =
|
||||||
system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(
|
system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(handle);
|
||||||
static_cast<Handle>(handle));
|
R_UNLESS(thread.IsNotNull(), ResultInvalidHandle);
|
||||||
|
|
||||||
// Cancel the thread's wait.
|
// Cancel the thread's wait.
|
||||||
thread->WaitCancel();
|
thread->WaitCancel();
|
||||||
|
|
Loading…
Reference in New Issue