Author: cgutman
Date: Mon Jan 23 00:39:28 2012
New Revision: 55086
URL: http://svn.reactos.org/svn/reactos?rev=55086&view=rev
Log:
[USB-BRINGUP-TRUNK]
- Fix a broken check that resulted in freeing the same device object twice
- Enable the IoDetachDevice call in usbstor now that the kernel bug is fixed
Modified:
branches/usb-bringup-trunk/drivers/usb/usbstor/fdo.c
branches/usb-bringup-trunk/ntoskrnl/io/iomgr/device.c
Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/fdo.c
URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbstor/fdo.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/usb/usbstor/fdo.c [iso-8859-1] Mon Jan 23 00:39:28 2012
@@ -135,7 +135,7 @@
Status = IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
/* Detach from the device stack */
- /* IoDetachDevice(DeviceExtension->LowerDeviceObject); */ //This crashes for some reason during unload
+ IoDetachDevice(DeviceExtension->LowerDeviceObject);
/* Delete the device object */
IoDeleteDevice(DeviceObject);
Modified: branches/usb-bringup-trunk/ntoskrnl/io/iomgr/device.c
URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/ntoskrnl/io/i…
==============================================================================
--- branches/usb-bringup-trunk/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/ntoskrnl/io/iomgr/device.c [iso-8859-1] Mon Jan 23 00:39:28 2012
@@ -420,10 +420,10 @@
/*
* Check if we have an attached device and fail if we're attached
- * and still have a reference count.
+ * or still have a reference count.
*/
AttachedDeviceObject = DeviceObject->AttachedDevice;
- if ((AttachedDeviceObject) && (DeviceObject->ReferenceCount)) return;
+ if ((AttachedDeviceObject) || (DeviceObject->ReferenceCount)) return;
/* Check if we have a Security Descriptor */
if (DeviceObject->SecurityDescriptor)