- Fix a bug where a spinlock was acquired on not initialized local variable
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sat, 12 Feb 2011 18:55:52 +0000 (18:55 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sat, 12 Feb 2011 18:55:52 +0000 (18:55 +0000)
svn path=/trunk/; revision=50673

reactos/drivers/ksfilter/ks/swenum.c

index 08d5286..8430b64 100644 (file)
@@ -1156,12 +1156,12 @@ KspBusWorkerRoutine(
     BOOLEAN DoInvalidate = FALSE;
     KIRQL OldLevel;
 
     BOOLEAN DoInvalidate = FALSE;
     KIRQL OldLevel;
 
-    /* acquire lock */
-    KeAcquireSpinLock(&BusDeviceExtension->Lock, &OldLevel);
-
     /* get device extension */
     BusDeviceExtension = (PBUS_ENUM_DEVICE_EXTENSION)Parameter;
 
     /* get device extension */
     BusDeviceExtension = (PBUS_ENUM_DEVICE_EXTENSION)Parameter;
 
+    /* acquire lock */
+    KeAcquireSpinLock(&BusDeviceExtension->Lock, &OldLevel);
+
     /* get current time */
     KeQuerySystemTime(&Time);
 
     /* get current time */
     KeQuerySystemTime(&Time);