diff options
| author | 2021-06-09 22:36:42 -0700 | |
|---|---|---|
| committer | 2021-06-09 22:36:42 -0700 | |
| commit | b259e95c09f231571c6a1c66046ff859019b1733 (patch) | |
| tree | 2e810f84e6d0f3ae62444ee3ba62cb91a48e5cfd /src | |
| parent | hle: service: sm: Fix GetService setup of session & port. (diff) | |
| download | yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.gz yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.xz yuzu-b259e95c09f231571c6a1c66046ff859019b1733.zip | |
hle: kernel: KClientPort: Add an assert for session count.
- Prevents us from over decrementing num_sessions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/k_client_port.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp index bcb884e8a..ef168fe87 100644 --- a/src/core/hle/kernel/k_client_port.cpp +++ b/src/core/hle/kernel/k_client_port.cpp | |||
| @@ -28,6 +28,9 @@ void KClientPort::Initialize(KPort* parent_port_, s32 max_sessions_, std::string | |||
| 28 | void KClientPort::OnSessionFinalized() { | 28 | void KClientPort::OnSessionFinalized() { |
| 29 | KScopedSchedulerLock sl{kernel}; | 29 | KScopedSchedulerLock sl{kernel}; |
| 30 | 30 | ||
| 31 | // This might happen if a session was improperly used with this port. | ||
| 32 | ASSERT_MSG(num_sessions > 0, "num_sessions is invalid"); | ||
| 33 | |||
| 31 | const auto prev = num_sessions--; | 34 | const auto prev = num_sessions--; |
| 32 | if (prev == max_sessions) { | 35 | if (prev == max_sessions) { |
| 33 | this->NotifyAvailable(); | 36 | this->NotifyAvailable(); |