https://git.reactos.org/?p=reactos.git;a=commitdiff;h=79c29720352853f7d2e0795f45811653c063ac2b

commit 79c29720352853f7d2e0795f45811653c063ac2b
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Tue Jun 22 12:00:46 2021 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Tue Jun 29 11:49:20 2021 +0200

    [NTOS:KD] Release lock before calling KdpPrint
    
    Avoiding resursive spinlock acquisition
---
 ntoskrnl/kd/kdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c
index 9c35c9586e9..3dabd050d26 100644
--- a/ntoskrnl/kd/kdio.c
+++ b/ntoskrnl/kd/kdio.c
@@ -772,6 +772,9 @@ KdReceivePacket(
         OldIrql = KdpAcquireLock(&KdpSerialSpinLock);
     }
 
+    /* Release the spinlock */
+    KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
+
     /* Print a new line */
     *StringChar.Buffer = '\n';
     KdpPrintString(&StringChar);
@@ -783,9 +786,6 @@ KdReceivePacket(
     if (!(KdbDebugState & KD_DEBUG_KDSERIAL))
         KbdEnableMouse();
 
-    /* Release the spinlock */
-    KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
-
 #endif
     return KdPacketReceived;
 }

Reply via email to