summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-16 07:30:21 +0200
committerGitHub <noreply@github.com>2021-05-16 07:30:21 +0200
commit5a2b15bf75318987d773a2bc69bd6224a28b7939 (patch)
treef213f5b011410022e8e98f7c3905d16d575ed413 /src/core/hle/kernel/svc.cpp
parentMerge pull request #6289 from ameerj/oob-blit (diff)
parentcommon: tree: Avoid a nullptr dereference. (diff)
downloadyuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.gz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.bz2
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.lz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.xz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.zst
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.zip
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 52011be9c..6b445677e 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -284,12 +284,11 @@ static ResultCode ConnectToNamedPort(Core::System& system, Handle* out, VAddr po
auto& handle_table = kernel.CurrentProcess()->GetHandleTable();
// Find the client port.
- const auto it = kernel.FindNamedPort(port_name);
- if (!kernel.IsValidNamedPort(it)) {
- LOG_WARNING(Kernel_SVC, "tried to connect to unknown port: {}", port_name);
+ auto port = kernel.CreateNamedServicePort(port_name);
+ if (!port) {
+ LOG_ERROR(Kernel_SVC, "tried to connect to unknown port: {}", port_name);
return ResultNotFound;
}
- auto port = it->second;
// Reserve a handle for the port.
// NOTE: Nintendo really does write directly to the output handle here.