summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2025-05-13 11:03:52 -0700
committerLiming Gao <gaoliming@byosoft.com.cn>2025-07-01 09:52:41 +0800
commit6cc56c6a2e2a1f9a40511811d23813847091a884 (patch)
treec76b150cfe482d68b1dd4454c3fc0c62c7f08a64
parent2d6b8d5ac951ee432512ca28db41ce32d0616849 (diff)
downloadedk2-6cc56c6a2e2a1f9a40511811d23813847091a884.zip
edk2-6cc56c6a2e2a1f9a40511811d23813847091a884.tar.gz
edk2-6cc56c6a2e2a1f9a40511811d23813847091a884.tar.bz2
MdeModulePkg: SmmCommunicationBuffer cumulative codeql issues.
Running Codeql on MdeModulePkg/Universal/SmmCommunicationBuffer drivers results in codeql errors stemming from missing null tests. Signed-off-by: Aaron Pop <aaronpop@microsoft.com> Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com> Co-authored-by: Taylor Beebe <tabeebe@microsoft.com> Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com> Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com> Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com> Co-authored-by: Sean Brogan <sean.brogan@microsoft.com> Co-authored-by: Aaron <aaronpop@microsoft>
-rw-r--r--MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c
index a47311c..8121e0c 100644
--- a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c
+++ b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c
@@ -63,6 +63,10 @@ SmmCommunicationBufferEntryPoint (
//
PiSmmCommunicationRegionTable = AllocateReservedPool (sizeof (EDKII_PI_SMM_COMMUNICATION_REGION_TABLE) + DescriptorSize);
ASSERT (PiSmmCommunicationRegionTable != NULL);
+ if (PiSmmCommunicationRegionTable == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
ZeroMem (PiSmmCommunicationRegionTable, sizeof (EDKII_PI_SMM_COMMUNICATION_REGION_TABLE) + DescriptorSize);
PiSmmCommunicationRegionTable->Version = EDKII_PI_SMM_COMMUNICATION_REGION_TABLE_VERSION;