Don't use the OldIrql value from fmutex after releasing it.
authorHartmut Birr <osexpert@googlemail.com>
Sat, 26 Nov 2005 16:35:23 +0000 (16:35 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Sat, 26 Nov 2005 16:35:23 +0000 (16:35 +0000)
svn path=/trunk/; revision=19641

reactos/hal/halx86/generic/fmutex.c
reactos/ntoskrnl/ex/fmutex.c

index 2ada2b4..a7624ed 100644 (file)
@@ -56,8 +56,11 @@ VOID
 FASTCALL
 ExReleaseFastMutex(PFAST_MUTEX FastMutex)
 {
+    KIRQL OldIrql;
+
     /* Erase the owner */
     FastMutex->Owner = (PVOID)1;
+    OldIrql = FastMutex->OldIrql;
 
     /* Increase the count */
     if (InterlockedIncrement(&FastMutex->Count) <= 0)
@@ -67,7 +70,7 @@ ExReleaseFastMutex(PFAST_MUTEX FastMutex)
     }
 
     /* Lower IRQL back */
-    KfLowerIrql(FastMutex->OldIrql);
+    KfLowerIrql(OldIrql);
 }
 
 BOOLEAN
index 6b229e2..2c574e0 100644 (file)
@@ -106,10 +106,12 @@ VOID
 FASTCALL
 ExReleaseFastMutex (PFAST_MUTEX FastMutex)
 {
+    KIRQL oldIrql;
     ASSERT_IRQL(APC_LEVEL);
 
     /* Erase the owner */
     FastMutex->Owner = NULL;
+    OldIrql = FastMutex->OldIrql;
 
     /* Increase the count */
     if (InterlockedIncrement(&FastMutex->Count) <= 0)
@@ -119,7 +121,7 @@ ExReleaseFastMutex (PFAST_MUTEX FastMutex)
     }
 
     /* Lower IRQL back */
-    KfLowerIrql(FastMutex->OldIrql);
+    KfLowerIrql(OldIrql);
 }
 
 /*