[USBPORT] Use ExFreePoolWithTag() instead ExFreePool() for TtExtension. Add debug...
authorVadim Galyant <vgal@rambler.ru>
Fri, 8 Dec 2017 09:19:55 +0000 (18:19 +0900)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 21 Jan 2018 18:35:47 +0000 (19:35 +0100)
drivers/usb/usbport/device.c
drivers/usb/usbport/endpoint.c

index 7ea2fda..43ec4a5 100644 (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);
index 8633d9b..8bf9ca9 100644 (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;