From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: Mike Maslenkin <mike.maslenkin@gmail.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Bi, Dandan" <dandan.bi@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>,
"Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
"Wang, Jian J" <jian.j.wang@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVolBlock.c
Date: Fri, 8 Sep 2023 21:46:58 +0000 [thread overview]
Message-ID: <CO1PR11MB4929316C474D0A39945AE136D2EDA@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230901001032.52136-3-mike.maslenkin@gmail.com>
+Jian
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Thursday, August 31, 2023 5:11 PM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Kinney, Michael D <michael.d.kinney@intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Mike Maslenkin
> <mike.maslenkin@gmail.com>
> Subject: [PATCH 2/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in
> FwVolBlock.c
>
> FvbDev->LbaCache must be freed on error path before deallocating FvbDev.
>
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
> MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
> b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
> index d81334ce24d1..9f5f40e5cd49 100644
> --- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
> +++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
> @@ -551,6 +551,7 @@ ProduceFVBProtocolOnBuffer (
> //
>
> FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool
> (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
>
> if (FvbDev->DevicePath == NULL) {
>
> + FreePool (FvbDev->LbaCache);
>
> FreePool (FvbDev);
>
> return EFI_OUT_OF_RESOURCES;
>
> }
>
> @@ -563,6 +564,7 @@ ProduceFVBProtocolOnBuffer (
> //
>
> FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool
> (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
>
> if (FvbDev->DevicePath == NULL) {
>
> + FreePool (FvbDev->LbaCache);
>
> FreePool (FvbDev);
>
> return EFI_OUT_OF_RESOURCES;
>
> }
>
> --
> 2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108465): https://edk2.groups.io/g/devel/message/108465
Mute This Topic: https://groups.io/mt/101085565/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2023-09-08 21:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 0:10 [edk2-devel] [PATCH 0/2] MdeModulePkg/Core/Dxe: Fix memory leak issues Mike Maslenkin
2023-09-01 0:10 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVol.c Mike Maslenkin
2023-09-08 21:46 ` Michael D Kinney
2023-09-01 0:10 ` [edk2-devel] [PATCH 2/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVolBlock.c Mike Maslenkin
2023-09-08 21:46 ` Michael D Kinney [this message]
2023-09-08 21:40 ` [edk2-devel] [PATCH 0/2] MdeModulePkg/Core/Dxe: Fix memory leak issues Michael D Kinney
2023-09-08 21:49 ` Michael D Kinney
2023-09-11 0:55 ` 回复: " gaoliming via groups.io
2023-09-11 2:30 ` Michael D Kinney
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=CO1PR11MB4929316C474D0A39945AE136D2EDA@CO1PR11MB4929.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