summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-07 02:54:06 +0200
committerbunnei <bunneidev@gmail.com>2021-06-07 02:54:06 +0200
commitada4242c014d791379c02bf4222a39a9e881a692 (patch)
tree6a9e153008d7b927cec278c0d481a2be04cb5736
parenthle: kernel: k_server_session: Ensure service thread is valid before dereference. (diff)
downloadyuzu-ada4242c014d791379c02bf4222a39a9e881a692.tar
yuzu-ada4242c014d791379c02bf4222a39a9e881a692.tar.gz
yuzu-ada4242c014d791379c02bf4222a39a9e881a692.tar.bz2
yuzu-ada4242c014d791379c02bf4222a39a9e881a692.tar.lz
yuzu-ada4242c014d791379c02bf4222a39a9e881a692.tar.xz
yuzu-ada4242c014d791379c02bf4222a39a9e881a692.tar.zst
yuzu-ada4242c014d791379c02bf4222a39a9e881a692.zip
-rw-r--r--src/core/hle/kernel/hle_ipc.h6
-rw-r--r--src/core/hle/kernel/k_server_session.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 159565203..2aaf93fca 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -85,8 +85,8 @@ public:
*/
void ClientDisconnected(KServerSession* session);
- std::weak_ptr<ServiceThread> GetServiceThread() const {
- return service_thread;
+ std::shared_ptr<ServiceThread> GetServiceThread() const {
+ return service_thread.lock();
}
protected:
@@ -152,7 +152,7 @@ public:
session_handler = std::move(handler);
}
- std::weak_ptr<ServiceThread> GetServiceThread() const {
+ std::shared_ptr<ServiceThread> GetServiceThread() const {
return session_handler->GetServiceThread();
}
diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp
index 96c8d7b0e..b231f8183 100644
--- a/src/core/hle/kernel/k_server_session.cpp
+++ b/src/core/hle/kernel/k_server_session.cpp
@@ -119,7 +119,7 @@ ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memor
context->PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf);
- if (auto strong_ptr = manager->GetServiceThread().lock(); strong_ptr) {
+ if (auto strong_ptr = manager->GetServiceThread(); strong_ptr) {
strong_ptr->QueueSyncRequest(*parent, std::move(context));
return ResultSuccess;
} else {