From f2e7a2a9babb798c8f48c9f50f221bf059c15cc9 Mon Sep 17 00:00:00 2001 From: ANR2ME Date: Thu, 4 Feb 2021 10:15:29 +0700 Subject: [PATCH] Fix possible lock issue during AdhocMatchingStart --- Core/HLE/sceNetAdhoc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index e14e05946c..e1db176c13 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -4661,8 +4661,10 @@ int NetAdhocMatching_Start(int matchingId, int evthPri, int evthPartitionId, int // Create PDP Socket int sock = sceNetAdhocPdpCreate((const char*)&item->mac, static_cast(item->port), item->rxbuflen, 0); item->socket = sock; - if (sock < 1) + if (sock < 1) { + peerlock.unlock(); return hleLogError(SCENET, ERROR_NET_ADHOC_MATCHING_PORT_IN_USE, "adhoc matching port in use"); + } // Create & Start the Fake PSP Thread ("matching_ev%d" and "matching_io%d") netAdhocValidateLoopMemory();