summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-10 07:36:42 +0200
committerbunnei <bunneidev@gmail.com>2021-06-10 07:36:42 +0200
commitb259e95c09f231571c6a1c66046ff859019b1733 (patch)
tree2e810f84e6d0f3ae62444ee3ba62cb91a48e5cfd /src/core/hle/kernel
parenthle: service: sm: Fix GetService setup of session & port. (diff)
downloadyuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar
yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.gz
yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.bz2
yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.lz
yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.xz
yuzu-b259e95c09f231571c6a1c66046ff859019b1733.tar.zst
yuzu-b259e95c09f231571c6a1c66046ff859019b1733.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/k_client_port.cpp3
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
void KClientPort::OnSessionFinalized() {
KScopedSchedulerLock sl{kernel};
+ // This might happen if a session was improperly used with this port.
+ ASSERT_MSG(num_sessions > 0, "num_sessions is invalid");
+
const auto prev = num_sessions--;
if (prev == max_sessions) {
this->NotifyAvailable();