public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "Pabba, PhanindraX Babu" <phanindrax.babu.pabba@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Chiu, Chasel" <chasel.chiu@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	"Dong, Eric" <eric.dong@intel.com>
Subject: Re: [edk2-devel] [PATCH] MinPlatformPkg: Add missed call to FreePool
Date: Mon, 25 Mar 2024 22:36:02 +0000	[thread overview]
Message-ID: <MW4PR11MB5821F9210AAA2A4E5E530BB0CD362@MW4PR11MB5821.namprd11.prod.outlook.com> (raw)
In-Reply-To: <03a7571c56639af46ecc7b59ac2aa65ee2ceacdf.1708667871.git.phanindrax.babu.pabba@intel.com>

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 <phanindrax.babu.pabba@intel.com> 
Sent: Thursday, February 22, 2024 10:01 PM
To: devel@edk2.groups.io
Cc: Pabba, PhanindraX Babu <phanindrax.babu.pabba@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [PATCH] MinPlatformPkg: Add missed call to FreePool

From: PhanindraX Babu Pabba <phanindrax.babu.pabba@intel.com>

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

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: PhanindraX Babu Pabba <phanindrax.babu.pabba@intel.com>
---
 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,                          &TableHandle                          );-+  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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-03-25 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23  6:01 [edk2-devel] [PATCH] MinPlatformPkg: Add missed call to FreePool phanindrax.babu.pabba
2024-03-25 22:36 ` Nate DeSimone [this message]
2024-03-27 19:10 phanindrax.babu.pabba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR11MB5821F9210AAA2A4E5E530BB0CD362@MW4PR11MB5821.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox