{
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
ErrorHandlerWorkItemData);
ErrorHandlerWorkItemData->DeviceObject = Context->FDODeviceExtension->FunctionalDeviceObject;
- ErrorHandlerWorkItemData->Irp = Irp;
ErrorHandlerWorkItemData->Context = Context;
DPRINT1("Queuing WorkItemROutine\n");
ExQueueWorkItem(&ErrorHandlerWorkItemData->WorkQueueItem, DelayedWorkQueue);
KeSetEvent(Context->Event, 0, FALSE);
}
+ //
+ // free our allocated irp
+ //
+ IoFreeIrp(Irp);
//
// free context