Skip to content

Commit

Permalink
[USBSTOR] Don't assert on clean up if initization didnt finish
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFire01 committed Sep 30, 2024
1 parent f4be6dc commit cdd3643
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions drivers/usb/usbstor/fdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cdd3643

Please sign in to comment.