[USBPORT] Use ExFreePoolWithTag() instead ExFreePool() for TtExtension. Add debug info.

This commit is contained in:
Vadim Galyant 2017-12-08 18:19:55 +09:00 committed by Amine Khaldi
parent 3bda39fcb8
commit 67138e7d54
2 changed files with 10 additions and 7 deletions

View file

@ -7,7 +7,7 @@
#include "usbport.h"
#define NDEBUG
//#define NDEBUG
#include <debug.h>
NTSTATUS
@ -1654,7 +1654,8 @@ USBPORT_RemoveDevice(IN PDEVICE_OBJECT FdoDevice,
FdoExtension->Bandwidth[ix] += TtExtension->MaxBandwidth;
}
ExFreePool(TtExtension);
DPRINT("USBPORT_RemoveDevice: ExFreePoolWithTag TtExtension - %p\n", TtExtension);
ExFreePoolWithTag(TtExtension, USB_PORT_TAG);
}
KeReleaseSpinLock(&FdoExtension->TtSpinLock, OldIrql);

View file

@ -504,7 +504,7 @@ USBPORT_DeleteEndpoint(IN PDEVICE_OBJECT FdoDevice,
BOOLEAN Result;
KIRQL OldIrql;
DPRINT("USBPORT_DeleteEndpoint: Endpoint - %p\n", Endpoint);
DPRINT1("USBPORT_DeleteEndpoint: Endpoint - %p\n", Endpoint);
FdoExtension = FdoDevice->DeviceExtension;
@ -602,7 +602,7 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
BOOLEAN IsReady;
KIRQL OldIrql;
DPRINT("USBPORT_ClosePipe \n");
DPRINT1("USBPORT_ClosePipe \n");
FdoExtension = FdoDevice->DeviceExtension;
@ -679,6 +679,7 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
KeAcquireSpinLock(&FdoExtension->TtSpinLock, &OldIrql);
TtExtension = Endpoint->TtExtension;
DPRINT1("USBPORT_ClosePipe: TtExtension - %p\n", TtExtension);
if (TtExtension)
{
@ -698,7 +699,8 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
FdoExtension->Bandwidth[ix] += TtExtension->MaxBandwidth;
}
ExFreePool(TtExtension);
DPRINT1("USBPORT_ClosePipe: ExFreePoolWithTag TtExtension - %p\n", TtExtension);
ExFreePoolWithTag(TtExtension, USB_PORT_TAG);
}
}
}
@ -785,7 +787,7 @@ USBPORT_OpenPipe(IN PDEVICE_OBJECT FdoDevice,
USHORT AdditionalTransaction;
BOOLEAN IsAllocatedBandwidth;
DPRINT("USBPORT_OpenPipe: DeviceHandle - %p, FdoDevice - %p, PipeHandle - %p\n",
DPRINT1("USBPORT_OpenPipe: DeviceHandle - %p, FdoDevice - %p, PipeHandle - %p\n",
DeviceHandle,
FdoDevice,
PipeHandle);
@ -1172,7 +1174,7 @@ USBPORT_ReopenPipe(IN PDEVICE_OBJECT FdoDevice,
KIRQL MiniportOldIrql;
NTSTATUS Status;
DPRINT("USBPORT_ReopenPipe ... \n");
DPRINT1("USBPORT_ReopenPipe ... \n");
FdoExtension = FdoDevice->DeviceExtension;
Packet = &FdoExtension->MiniPortInterface->Packet;