[NTOSKRNL]

- Release the IO database lock before unloading the device (and driver too) to prevent deadlocks

svn path=/trunk/; revision=56089
This commit is contained in:
Cameron Gutman 2012-03-08 03:02:28 +00:00
parent e0c8eedd51
commit a7caca2e37

View file

@ -50,6 +50,9 @@ IopDecrementDeviceObjectRef(IN PDEVICE_OBJECT DeviceObject,
return; return;
} }
/* Release lock */
KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, OldIrql);
/* Here, DO is not referenced any longer, check if we have to unload it */ /* Here, DO is not referenced any longer, check if we have to unload it */
if (UnloadIfUnused || IoGetDevObjExtension(DeviceObject)->ExtensionFlags & if (UnloadIfUnused || IoGetDevObjExtension(DeviceObject)->ExtensionFlags &
(DOE_UNLOAD_PENDING | DOE_DELETE_PENDING | DOE_REMOVE_PENDING)) (DOE_UNLOAD_PENDING | DOE_DELETE_PENDING | DOE_REMOVE_PENDING))
@ -57,9 +60,6 @@ IopDecrementDeviceObjectRef(IN PDEVICE_OBJECT DeviceObject,
/* Unload the driver */ /* Unload the driver */
IopUnloadDevice(DeviceObject); IopUnloadDevice(DeviceObject);
} }
/* Release lock */
KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, OldIrql);
} }
/* /*