X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=drivers%2Fusb%2Fusbstor%2Ffdo.c;h=6879b4efe8f7d3b3153ed5c8b20ede147a1e6ee5;hp=1c1949533f94b7365678c2ad14cdee00188d19ce;hb=40b25634ffcfd13ce98c338cdc272f1aa1d4bbf2;hpb=fa530aee92e417e4330c604bbe6ea2e9100709dc diff --git a/drivers/usb/usbstor/fdo.c b/drivers/usb/usbstor/fdo.c index 1c1949533f9..6879b4efe8f 100644 --- a/drivers/usb/usbstor/fdo.c +++ b/drivers/usb/usbstor/fdo.c @@ -108,8 +108,27 @@ 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->SerialNumber) + { + ExFreePoolWithTag(DeviceExtension->SerialNumber, USB_STOR_TAG); + } + // Send the IRP down the stack IoSkipCurrentIrpStackLocation(Irp); + Irp->IoStatus.Status = STATUS_SUCCESS; Status = IoCallDriver(DeviceExtension->LowerDeviceObject, Irp); // Detach from the device stack