diff --git a/drivers/usb/usbstor/fdo.c b/drivers/usb/usbstor/fdo.c index 40c4626c8d6..92801b1ef4e 100644 --- a/drivers/usb/usbstor/fdo.c +++ b/drivers/usb/usbstor/fdo.c @@ -118,22 +118,16 @@ USBSTOR_FdoHandleRemoveDevice( } // Freeing everything in DeviceExtension - ASSERT( - DeviceExtension->DeviceDescriptor && - DeviceExtension->ConfigurationDescriptor && - DeviceExtension->InterfaceInformation && - DeviceExtension->ResetDeviceWorkItem - ); - - ExFreePoolWithTag(DeviceExtension->DeviceDescriptor, USB_STOR_TAG); - ExFreePoolWithTag(DeviceExtension->ConfigurationDescriptor, USB_STOR_TAG); - ExFreePoolWithTag(DeviceExtension->InterfaceInformation, USB_STOR_TAG); - IoFreeWorkItem(DeviceExtension->ResetDeviceWorkItem); - + if (DeviceExtension->DeviceDescriptor) + ExFreePoolWithTag(DeviceExtension->DeviceDescriptor, USB_STOR_TAG); + if (DeviceExtension->ConfigurationDescriptor) + ExFreePoolWithTag(DeviceExtension->ConfigurationDescriptor, USB_STOR_TAG); + if (DeviceExtension->InterfaceInformation) + ExFreePoolWithTag(DeviceExtension->InterfaceInformation, USB_STOR_TAG); + if (DeviceExtension->ResetDeviceWorkItem) + IoFreeWorkItem(DeviceExtension->ResetDeviceWorkItem); if (DeviceExtension->SerialNumber) - { ExFreePoolWithTag(DeviceExtension->SerialNumber, USB_STOR_TAG); - } // Send the IRP down the stack IoSkipCurrentIrpStackLocation(Irp);