From ec5674a6ad89ec705e835d2b711dca18f4ef1616 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 9 Jun 2021 22:29:18 -0700 Subject: hle: service: sm: Fix GetService setup of session & port. --- src/core/hle/kernel/k_client_port.cpp | 2 +- src/core/hle/service/sm/sm.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp index 50606bd91..bcb884e8a 100644 --- a/src/core/hle/kernel/k_client_port.cpp +++ b/src/core/hle/kernel/k_client_port.cpp @@ -66,7 +66,7 @@ ResultCode KClientPort::CreateSession(KClientSession** out, // Update the session counts. { // Atomically increment the number of sessions. - s32 new_sessions; + s32 new_sessions{}; { const auto max = max_sessions; auto cur_sessions = num_sessions.load(std::memory_order_acquire); diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index bffa9ffcb..a1e1a7d76 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -164,18 +164,18 @@ ResultVal SM::GetServiceImpl(Kernel::HLERequestContext& R_UNLESS(session_reservation.Succeeded(), Kernel::ResultLimitReached); // Create a new session. - auto* session = Kernel::KSession::Create(kernel); - session->Initialize(&port->GetClientPort(), std::move(name)); + Kernel::KClientSession* session{}; + port->GetClientPort().CreateSession(std::addressof(session)); // Commit the session reservation. session_reservation.Commit(); // Enqueue the session with the named port. - port->EnqueueSession(&session->GetServerSession()); + port->EnqueueSession(&session->GetParent()->GetServerSession()); LOG_DEBUG(Service_SM, "called service={} -> session={}", name, session->GetId()); - return MakeResult(&session->GetClientSession()); + return MakeResult(session); } void SM::RegisterService(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3