summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c10
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c6
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Atapi.c2
-rw-r--r--IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c4
-rw-r--r--IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.c9
-rw-r--r--IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c4
-rw-r--r--IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c4
7 files changed, 31 insertions, 8 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
index b09193cee..59c416628 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
@@ -353,11 +353,13 @@ ErrorExit:
// Since there will be no timer handler for keyboard input any more,
// exhaust input data just in case there is still keyboard data left
//
- Status1 = EFI_SUCCESS;
- while (!EFI_ERROR (Status1)) {
- Status1 = KeyboardRead (ConsoleIn, &Data);;
+ if (ConsoleIn != NULL) {
+ Status1 = EFI_SUCCESS;
+ while (!EFI_ERROR (Status1)) {
+ Status1 = KeyboardRead (ConsoleIn, &Data);;
+ }
}
-
+
if (ConsoleIn != NULL) {
gBS->FreePool (ConsoleIn);
}
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
index 4a57f11bf..25ecedb78 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
@@ -63,6 +63,9 @@ ATAIdentify (
// the ATA Identify command
//
AtaIdentifyPointer = (EFI_IDENTIFY_DATA *) AllocateZeroPool (sizeof (EFI_IDENTIFY_DATA));
+ if (AtaIdentifyPointer == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
//
// use ATA PIO Data In protocol to send ATA Identify command
@@ -1824,6 +1827,9 @@ AtaSMARTSupport (
// Detect if this feature is enabled
//
TmpAtaIdentifyPointer = (EFI_IDENTIFY_DATA *) AllocateZeroPool (sizeof (EFI_IDENTIFY_DATA));
+ if (TmpAtaIdentifyPointer == NULL) {
+ return;
+ }
DeviceSelect = (UINT8) ((IdeDev->Device) << 4);
Status = AtaPioDataIn (
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Atapi.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Atapi.c
index e3515d254..1f989e72f 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Atapi.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Atapi.c
@@ -1791,7 +1791,7 @@ AtapiBlkIoReadBlocks (
//
if (LBA == 0 && (IdeBlkIoDevice->Cache == NULL)) {
IdeBlkIoDevice->Cache = AllocatePool (BlockSize);
- if (IdeBlkIoDevice != NULL) {
+ if (IdeBlkIoDevice->Cache!= NULL) {
CopyMem ((UINT8 *) IdeBlkIoDevice->Cache, (UINT8 *) Buffer, BlockSize);
}
}
diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c
index 602e42b18..bfa5e5130 100644
--- a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c
+++ b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c
@@ -125,7 +125,9 @@ InternalReportStatusCodeEx (
//
// Fill in the extended data buffer
//
- CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
+ if (ExtendedData != NULL) {
+ CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
+ }
//
// Report the status code
diff --git a/IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.c b/IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.c
index 08c95b652..61a936de1 100644
--- a/IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.c
+++ b/IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.c
@@ -137,6 +137,9 @@ PciResourceUpdateCheck (
AcpiPtr = AllocateZeroPool (
sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)
);
+ if (AcpiPtr == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
OldAcpiPtr = AcpiPtr;
@@ -255,6 +258,9 @@ PciRegisterUpdateCheck (
Dsc = (EFI_PCI_REGISTER_VALUE_DATA *) (ListPtr + 2);
RegisterPtr = AllocateZeroPool (sizeof (EFI_PCI_REGISTER_VALUE_DATA));
+ if (RegisterPtr == NULL) {
+ return EFI_SUCCESS;
+ }
RegisterPtr->AndValue = Dsc->AndValue;
RegisterPtr->OrValue = Dsc->OrValue;
@@ -356,6 +362,9 @@ PciRegisterAccessCheck (
if((Dsc->StartOffset <= Offset) && (Dsc->EndOffset > Offset)) {
RegisterPtr = AllocateZeroPool (sizeof (EFI_PCI_REGISTER_ACCESS_DATA));
+ if (RegisterPtr == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
RegisterPtr->StartOffset = Dsc->StartOffset;
RegisterPtr->EndOffset = Dsc->EndOffset;
diff --git a/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
index d027dc4a8..4f0901b1d 100644
--- a/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
+++ b/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
@@ -471,7 +471,9 @@ ReportStatusCodeEx (
ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
}
CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
- CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
+ if (ExtendedData != NULL) {
+ CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
+ }
if (CallerId == NULL) {
CallerId = &gEfiCallerIdGuid;
}
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c
index c68016083..e176ecc36 100644
--- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c
+++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c
@@ -292,7 +292,9 @@ InternalReportStatusCodeEx (
//
// Fill in the extended data buffer
//
- CopyMem (mStatusCodeData + 1, ExtendedData, ExtendedDataSize);
+ if (ExtendedData != NULL) {
+ CopyMem (mStatusCodeData + 1, ExtendedData, ExtendedDataSize);
+ }
//
// Report the status code