diff options
| author | 2021-06-09 15:24:46 -0700 | |
|---|---|---|
| committer | 2021-06-09 15:24:46 -0700 | |
| commit | c63ea608aa10b35c7b3cd418cbbc3df8d8bbde73 (patch) | |
| tree | 39910198e1a7668a6cc15578bc2d7a15aab20b04 | |
| parent | Merge pull request #6436 from liushuyu/master (diff) | |
| download | yuzu-c63ea608aa10b35c7b3cd418cbbc3df8d8bbde73.tar.gz yuzu-c63ea608aa10b35c7b3cd418cbbc3df8d8bbde73.tar.xz yuzu-c63ea608aa10b35c7b3cd418cbbc3df8d8bbde73.zip | |
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.
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 28bcae6e7..8339e11a0 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -449,8 +449,8 @@ static ResultCode CancelSynchronization(Core::System& system, Handle handle) { | |||
| 449 | 449 | ||
| 450 | // Get the thread from its handle. | 450 | // Get the thread from its handle. |
| 451 | KScopedAutoObject thread = | 451 | KScopedAutoObject thread = |
| 452 | system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>( | 452 | system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(handle); |
| 453 | static_cast<Handle>(handle)); | 453 | R_UNLESS(thread.IsNotNull(), ResultInvalidHandle); |
| 454 | 454 | ||
| 455 | // Cancel the thread's wait. | 455 | // Cancel the thread's wait. |
| 456 | thread->WaitCancel(); | 456 | thread->WaitCancel(); |