From nobody Thu May 16 08:07:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+108221+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108221+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1693527043; cv=none; d=zohomail.com; s=zohoarc; b=dyNEs8VjCkyxNxts2fBBeFM9rPn+mX/87MFKr9ZH3Wa9oxJoUb8h/e81mrmDo6MzMKRoM6dKJ7kVAEtVSxuTKUxfW/wJWvHgOENoT8+4JfYgDjh97aFDp+mjvL4exzBiOSJiwIKjOePoRG6G5ijKLljN9YDWwctgl5o/9kR/S8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693527043; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Ee/fwwJ18SnUWXrG+KEEHbka/MZATYZIqm0hNPCi5g4=; b=gDzOWxHEPh0ArqO8TUFsadF+IvIyl6U2k91hhDDU3zzuSGlCq6pBCz0/kdQyqXtUY8OPsGX5EtpHot5SXprJN1CP572Bil6iENccUshh1NIRe7qNqoY5Z1wOuJkzaRZ3CVT8C50NmFTa41hewLoEp5a0LRcNQ/PIX7H3eCRTR1g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108221+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1693527043444323.656053707968; Thu, 31 Aug 2023 17:10:43 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=bkzJmaz0P1wpWPBbYNwtpDFtu/nkW/XaSwfkO0Jdb6w=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1693527043; v=1; b=VgIYbmfPdE9om0BjWyJDT9UI4ce5ieHd/9O6GpVrNnAbj2J9lODCDSYAP7ZzhRfyZFHoP6ZS 90WQpEz6Mu+KzQQhXMmKrLFbSCE7hnGpS16KuLokkrn/Qb2RnQ2vj0ji5LnpUXl4jgouEXe4X4n fFyHgHTX3gkLfZFpm9ZcXoHs= X-Received: by 127.0.0.2 with SMTP id ipbrYY1788612xkyqYGdTRv8; Thu, 31 Aug 2023 17:10:43 -0700 X-Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web10.9811.1693527042338404227 for ; Thu, 31 Aug 2023 17:10:42 -0700 X-Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-500b6456c7eso2667959e87.2 for ; Thu, 31 Aug 2023 17:10:42 -0700 (PDT) X-Gm-Message-State: 3Ta1av7OhfzgrWtuyGEGCax1x1787277AA= X-Google-Smtp-Source: AGHT+IEtOktXKTwv2uSWWYOQS0V1lNgG4EUkz7f2Hp9CmTvHB9RSUedGzgiCsH00p6IFN3N7C/uB1Q== X-Received: by 2002:a05:6512:2089:b0:4fb:780d:2a49 with SMTP id t9-20020a056512208900b004fb780d2a49mr443268lfr.5.1693527040185; Thu, 31 Aug 2023 17:10:40 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id h22-20020a197016000000b004ffa0350851sm461422lfc.78.2023.08.31.17.10.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Aug 2023 17:10:39 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: dandan.bi@intel.com, gaoliming@byosoft.com.cn, michael.d.kinney@intel.com, nathaniel.l.desimone@intel.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 1/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVol.c Date: Fri, 1 Sep 2023 03:10:31 +0300 Message-Id: <20230901001032.52136-2-mike.maslenkin@gmail.com> In-Reply-To: <20230901001032.52136-1-mike.maslenkin@gmail.com> References: <20230901001032.52136-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1693527044718100007 Content-Type: text/plain; charset="utf-8" FwVolHeader must be deallocated on error path. Signed-off-by: Mike Maslenkin --- MdeModulePkg/Core/Dxe/FwVol/FwVol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/Fw= Vol/FwVol.c index 153bfecafa77..0c1554ba4d63 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c @@ -659,6 +659,7 @@ NotifyFwVolBlock ( // FvDevice =3D AllocateCopyPool (sizeof (FV_DEVICE), &mFvDevice); if (FvDevice =3D=3D NULL) { + CoreFreePool (FwVolHeader); return; } =20 --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108221): https://edk2.groups.io/g/devel/message/108221 Mute This Topic: https://groups.io/mt/101085563/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 16 08:07:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+108222+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108222+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1693527045; cv=none; d=zohomail.com; s=zohoarc; b=SLvTPe3bmTfPYlpo5U+6jib1QEvcKTI1MU29L+9HzuKyodwKo7S8L8Dln2fNbRUlpf74wg+yiEQJjPvl+Q54CxhG4JOKgbDxbK0jUpf7wAltoo5ZEsWHwCV47h2X18ojVKRwuwdG4+BpyN4TvkRSHq55lRjxBetTaY+2svjV1H8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693527045; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Fpf3MxFsRNSSdxyCbySVyIJS3nNX/wIvzue37hBMUcc=; b=fzyRKi+92t6mzY82IhVrTsCo0n+HgwqPIlx3sJZb9Tm78lb2yyy18Wi3wYJDDAQygnQdEaYqO5a7WYTAuqN3t7u7rvQiNbsaNDJW95DyvEwdIhpKI3ou+WqtGmUVKPoHZFWDfNdF0I4xPRm1E8aKkog2581cgmWeLstariVoXjY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108222+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1693527045490435.71075901040865; Thu, 31 Aug 2023 17:10:45 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=FlZ+WihPblHKLpUbXQjcRgC9RW+I6Skv8cCrKPrmrtc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1693527045; v=1; b=OUkqpz4QaXV0BYkjXIS9duQQAt7lvsgvuwEhV1TBJ95FGHwvc5s5BuE1e9iLGSpg+3U1iX5I urzK/0ZpOa/1ZJqxCZZZZqh+Eaw0Wk5W0KDYokZ7IaQG3aRFJHtU4SU/UXTndrGNnEwObrjuctD /zVPrHfH1hwBmwp1eoGGabxg= X-Received: by 127.0.0.2 with SMTP id RdEbYY1788612xJTxNbNDWfk; Thu, 31 Aug 2023 17:10:45 -0700 X-Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mx.groups.io with SMTP id smtpd.web11.9782.1693527044131436071 for ; Thu, 31 Aug 2023 17:10:44 -0700 X-Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-500b6456c7eso2667986e87.2 for ; Thu, 31 Aug 2023 17:10:43 -0700 (PDT) X-Gm-Message-State: Vr1ApYModHVB1tVHPIleO15Kx1787277AA= X-Google-Smtp-Source: AGHT+IF8c8J9ECjWJfkosVa/ZxED8Q2sl/co3Qgr8ifBF2YPtHePBdZK42WZzYJ+iHdFgphlUCN9tg== X-Received: by 2002:a05:6512:a8e:b0:4ff:ad35:8dce with SMTP id m14-20020a0565120a8e00b004ffad358dcemr638930lfu.22.1693527042246; Thu, 31 Aug 2023 17:10:42 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id h22-20020a197016000000b004ffa0350851sm461422lfc.78.2023.08.31.17.10.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Aug 2023 17:10:41 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: dandan.bi@intel.com, gaoliming@byosoft.com.cn, michael.d.kinney@intel.com, nathaniel.l.desimone@intel.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 2/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVolBlock.c Date: Fri, 1 Sep 2023 03:10:32 +0300 Message-Id: <20230901001032.52136-3-mike.maslenkin@gmail.com> In-Reply-To: <20230901001032.52136-1-mike.maslenkin@gmail.com> References: <20230901001032.52136-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1693527045959100010 Content-Type: text/plain; charset="utf-8" FvbDev->LbaCache must be freed on error path before deallocating FvbDev. Signed-off-by: Mike Maslenkin --- MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/C= ore/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 =3D (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (s= izeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); if (FvbDev->DevicePath =3D=3D NULL) { + FreePool (FvbDev->LbaCache); FreePool (FvbDev); return EFI_OUT_OF_RESOURCES; } @@ -563,6 +564,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (s= izeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); if (FvbDev->DevicePath =3D=3D NULL) { + FreePool (FvbDev->LbaCache); FreePool (FvbDev); return EFI_OUT_OF_RESOURCES; } --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108222): https://edk2.groups.io/g/devel/message/108222 Mute This Topic: https://groups.io/mt/101085565/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-