Author: cwittich
Date: Fri Jul 6 21:14:24 2007
New Revision: 27429
URL:
http://svn.reactos.org/svn/reactos?rev=27429&view=rev
Log:
Never call IoCompleteRequest while holding a spin lock. Attempting to complete an IRP
while holding a spin lock can cause deadlocks.
Modified:
trunk/reactos/drivers/input/kbdclass/kbdclass.c
trunk/reactos/drivers/input/mouclass/mouclass.c
Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbd…
==============================================================================
--- trunk/reactos/drivers/input/kbdclass/kbdclass.c (original)
+++ trunk/reactos/drivers/input/kbdclass/kbdclass.c Fri Jul 6 21:14:24 2007
@@ -797,10 +797,10 @@
/* Go to next packet and complete this request */
Irp->IoStatus.Status = Status;
+ KeReleaseSpinLock(&DeviceExtension->SpinLock, oldIrql);
+
IoCompleteRequest(Irp, IO_KEYBOARD_INCREMENT);
-
IoStartNextPacket(DeviceObject, FALSE);
- KeReleaseSpinLock(&DeviceExtension->SpinLock, oldIrql);
}
else
{
Modified: trunk/reactos/drivers/input/mouclass/mouclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mou…
==============================================================================
--- trunk/reactos/drivers/input/mouclass/mouclass.c (original)
+++ trunk/reactos/drivers/input/mouclass/mouclass.c Fri Jul 6 21:14:24 2007
@@ -773,10 +773,10 @@
/* Go to next packet and complete this request */
Irp->IoStatus.Status = Status;
+ KeReleaseSpinLock(&DeviceExtension->SpinLock, oldIrql);
+
IoCompleteRequest(Irp, IO_MOUSE_INCREMENT);
-
IoStartNextPacket(DeviceObject, FALSE);
- KeReleaseSpinLock(&DeviceExtension->SpinLock, oldIrql);
}
else
{