From 79c29720352853f7d2e0795f45811653c063ac2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 22 Jun 2021 12:00:46 +0200 Subject: [PATCH] [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; }