X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=drivers%2Fusb%2Fusbstor%2Fscsi.c;h=3c79700d96cd201081e56329de1b726f7ef43c7f;hp=6db9e1db3eb6ec45328e3ec7f43834d06370618a;hb=2f5db208deede6c9f4280da30684bfcc275c2788;hpb=75947d67083243b738d20cd515b3c63ed562be1f diff --git a/drivers/usb/usbstor/scsi.c b/drivers/usb/usbstor/scsi.c index 6db9e1db3eb..3c79700d96c 100644 --- a/drivers/usb/usbstor/scsi.c +++ b/drivers/usb/usbstor/scsi.c @@ -181,18 +181,9 @@ USBSTOR_CSWCompletionRoutine( { DPRINT1("Attempting Error Recovery\n"); // - // If a Read Capacity Request free TransferBuffer + // free the allocated irp // - if (pCDB->AsByte[0] == SCSIOP_READ_CAPACITY) - { - FreeItem(Context->TransferData); - } - - // - // Clean up the rest - // - FreeItem(Context->cbw); - FreeItem(Context); + IoFreeIrp(Irp); // // Allocate Work Item Data @@ -213,7 +204,6 @@ USBSTOR_CSWCompletionRoutine( ErrorHandlerWorkItemData); ErrorHandlerWorkItemData->DeviceObject = Context->FDODeviceExtension->FunctionalDeviceObject; - ErrorHandlerWorkItemData->Irp = Irp; ErrorHandlerWorkItemData->Context = Context; DPRINT1("Queuing WorkItemROutine\n"); ExQueueWorkItem(&ErrorHandlerWorkItemData->WorkQueueItem, DelayedWorkQueue); @@ -315,6 +305,10 @@ USBSTOR_CSWCompletionRoutine( KeSetEvent(Context->Event, 0, FALSE); } + // + // free our allocated irp + // + IoFreeIrp(Irp); // // free context