[ros-diffs] [cgutman] 56089: [NTOSKRNL] - Release the IO database lock before unloading the device (and driver too) to prevent deadlocks

cgutman at svn.reactos.org cgutman at svn.reactos.org
Thu Mar 8 03:02:28 UTC 2012


Author: cgutman
Date: Thu Mar  8 03:02:28 2012
New Revision: 56089

URL: http://svn.reactos.org/svn/reactos?rev=56089&view=rev
Log:
[NTOSKRNL]
- Release the IO database lock before unloading the device (and driver too) to prevent deadlocks

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/volume.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c?rev=56089&r1=56088&r2=56089&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/volume.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/volume.c [iso-8859-1] Thu Mar  8 03:02:28 2012
@@ -50,6 +50,9 @@
         return;
     }
 
+    /* Release lock */
+    KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, OldIrql);
+
     /* Here, DO is not referenced any longer, check if we have to unload it */
     if (UnloadIfUnused || IoGetDevObjExtension(DeviceObject)->ExtensionFlags &
                           (DOE_UNLOAD_PENDING | DOE_DELETE_PENDING | DOE_REMOVE_PENDING))
@@ -57,9 +60,6 @@
         /* Unload the driver */
         IopUnloadDevice(DeviceObject);
     }
-
-    /* Release lock */
-    KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, OldIrql);
 }
 
 /*




More information about the Ros-diffs mailing list