[edk2-devel] [PATCH] MinPlatformPkg: Add missed call to FreePool

2024-03-27 Thread phanindrax . babu . pabba
From: PhanindraX Babu Pabba 

Adding missed out call to FreePool API to free
the allocated memory.

Signed-off-by: PhanindraX Babu Pabba 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 2 +-
 Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 2a833ec9..f637e1c9 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1002,7 +1002,7 @@ InstallMcfgFromScratch (
  McfgTable->Header.Length,
  
  );
-
+  FreePool (McfgTable);
   return Status;
 }
 
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c 
b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
index 9bc22245..f5b1a71c 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
@@ -195,6 +195,7 @@ PublishAcpiTablesFromFv (
   // Increment the instance
   //
   Instance++;
+  FreePool (CurrentTable);
   CurrentTable = NULL;
 }
   }
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117180): https://edk2.groups.io/g/devel/message/117180
Mute This Topic: https://groups.io/mt/104524859/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] MinPlatformPkg: Add missed call to FreePool

2024-03-25 Thread Nate DeSimone
Hi Babu,

If the call to InitializeHeader() fails then the buffer will still not be 
de-allcoated properly. Please add a Done: label and a goto Done; so that the 
buffer will still be freed in the case of an error.

Thanks,
Nate

-Original Message-
From: Pabba, PhanindraX Babu  
Sent: Thursday, February 22, 2024 10:01 PM
To: devel@edk2.groups.io
Cc: Pabba, PhanindraX Babu ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Liming Gao ; Dong, 
Eric 
Subject: [PATCH] MinPlatformPkg: Add missed call to FreePool

From: PhanindraX Babu Pabba 

Adding missed out call to FreePool API to free the allocated memory.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: PhanindraX Babu Pabba 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 2 +-
 Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 2a833ec9..f637e1c9 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1002,7 +1002,7 @@ InstallMcfgFromScratch (
  McfgTable->Header.Length,  
  );-+  FreePool (McfgTable);   return 
Status; } diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c 
b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
index 9bc22245..f5b1a71c 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
@@ -195,6 +195,7 @@ PublishAcpiTablesFromFv (
   // Increment the instance   //   Instance++;+  FreePool 
(CurrentTable);   CurrentTable = NULL; }   }-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117095): https://edk2.groups.io/g/devel/message/117095
Mute This Topic: https://groups.io/mt/104524859/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] MinPlatformPkg: Add missed call to FreePool

2024-02-23 Thread phanindrax . babu . pabba
From: PhanindraX Babu Pabba 

Adding missed out call to FreePool API to free the
allocated memory.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: PhanindraX Babu Pabba 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 2 +-
 Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 2a833ec9..f637e1c9 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1002,7 +1002,7 @@ InstallMcfgFromScratch (
  McfgTable->Header.Length,
  
  );
-
+  FreePool (McfgTable);
   return Status;
 }
 
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c 
b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
index 9bc22245..f5b1a71c 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.c
@@ -195,6 +195,7 @@ PublishAcpiTablesFromFv (
   // Increment the instance
   //
   Instance++;
+  FreePool (CurrentTable);
   CurrentTable = NULL;
 }
   }
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115875): https://edk2.groups.io/g/devel/message/115875
Mute This Topic: https://groups.io/mt/104524859/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-