[ACPICA]
[reactos.git] / reactos / drivers / bus / acpi / acpica / utilities / uttrack.c
index 9efa9d6..2bb1801 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -107,14 +107,12 @@ AcpiUtCreateList (
     ACPI_MEMORY_LIST        *Cache;
 
 
-    Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));
+    Cache = AcpiOsAllocateZeroed (sizeof (ACPI_MEMORY_LIST));
     if (!Cache)
     {
         return (AE_NO_MEMORY);
     }
 
-    memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
-
     Cache->ListName = ListName;
     Cache->ObjectSize = ObjectSize;
 
@@ -670,6 +668,11 @@ AcpiUtDumpAllocations (
         return_VOID;
     }
 
+    if (!AcpiGbl_GlobalList)
+    {
+        goto Exit;
+    }
+
     Element = AcpiGbl_GlobalList->ListHead;
     while (Element)
     {
@@ -681,7 +684,7 @@ AcpiUtDumpAllocations (
 
             if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
             {
-                AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u "
+                AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u "
                     "[Not a Descriptor - too small]\n",
                     Descriptor, Element->Size, Element->Module,
                     Element->Line);
@@ -693,7 +696,7 @@ AcpiUtDumpAllocations (
                 if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) !=
                     ACPI_DESC_TYPE_CACHED)
                 {
-                    AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
+                    AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u [%s] ",
                         Descriptor, Element->Size, Element->Module,
                         Element->Line, AcpiUtGetDescriptorName (Descriptor));
 
@@ -769,6 +772,7 @@ AcpiUtDumpAllocations (
         Element = Element->Next;
     }
 
+Exit:
     (void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
 
     /* Print summary */