[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

svn path=/branches/usb-bringup-trunk/; revision=55086
This commit is contained in:
Cameron Gutman 2012-01-23 00:39:28 +00:00
parent 7ec08a5b86
commit 3de4023a19
2 changed files with 3 additions and 3 deletions

View file

@ -135,7 +135,7 @@ USBSTOR_FdoHandleRemoveDevice(
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);

View file

@ -420,10 +420,10 @@ IopUnloadDevice(IN PDEVICE_OBJECT DeviceObject)
/*
* 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)