https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67138e7d547469b6ac127…
commit 67138e7d547469b6ac127626ab975a47e6186833
Author: Vadim Galyant <vgal(a)rambler.ru>
AuthorDate: Fri Dec 8 18:19:55 2017 +0900
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Jan 21 19:35:47 2018 +0100
[USBPORT] Use ExFreePoolWithTag() instead ExFreePool() for TtExtension. Add debug
info.
---
drivers/usb/usbport/device.c | 5 +++--
drivers/usb/usbport/endpoint.c | 12 +++++++-----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/usbport/device.c b/drivers/usb/usbport/device.c
index 7ea2fda5ca..43ec4a58dc 100644
--- a/drivers/usb/usbport/device.c
+++ b/drivers/usb/usbport/device.c
@@ -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);
diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c
index 8633d9be8f..8bf9ca9cf7 100644
--- a/drivers/usb/usbport/endpoint.c
+++ b/drivers/usb/usbport/endpoint.c
@@ -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;