mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
fix Klocwork issues
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7926 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3fb46d0b04
commit
261136bc32
@ -353,9 +353,11 @@ ErrorExit:
|
|||||||
// Since there will be no timer handler for keyboard input any more,
|
// Since there will be no timer handler for keyboard input any more,
|
||||||
// exhaust input data just in case there is still keyboard data left
|
// exhaust input data just in case there is still keyboard data left
|
||||||
//
|
//
|
||||||
Status1 = EFI_SUCCESS;
|
if (ConsoleIn != NULL) {
|
||||||
while (!EFI_ERROR (Status1)) {
|
Status1 = EFI_SUCCESS;
|
||||||
Status1 = KeyboardRead (ConsoleIn, &Data);;
|
while (!EFI_ERROR (Status1)) {
|
||||||
|
Status1 = KeyboardRead (ConsoleIn, &Data);;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConsoleIn != NULL) {
|
if (ConsoleIn != NULL) {
|
||||||
|
@ -63,6 +63,9 @@ ATAIdentify (
|
|||||||
// the ATA Identify command
|
// the ATA Identify command
|
||||||
//
|
//
|
||||||
AtaIdentifyPointer = (EFI_IDENTIFY_DATA *) AllocateZeroPool (sizeof (EFI_IDENTIFY_DATA));
|
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
|
// use ATA PIO Data In protocol to send ATA Identify command
|
||||||
@ -1824,6 +1827,9 @@ AtaSMARTSupport (
|
|||||||
// Detect if this feature is enabled
|
// Detect if this feature is enabled
|
||||||
//
|
//
|
||||||
TmpAtaIdentifyPointer = (EFI_IDENTIFY_DATA *) AllocateZeroPool (sizeof (EFI_IDENTIFY_DATA));
|
TmpAtaIdentifyPointer = (EFI_IDENTIFY_DATA *) AllocateZeroPool (sizeof (EFI_IDENTIFY_DATA));
|
||||||
|
if (TmpAtaIdentifyPointer == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DeviceSelect = (UINT8) ((IdeDev->Device) << 4);
|
DeviceSelect = (UINT8) ((IdeDev->Device) << 4);
|
||||||
Status = AtaPioDataIn (
|
Status = AtaPioDataIn (
|
||||||
|
@ -1791,7 +1791,7 @@ AtapiBlkIoReadBlocks (
|
|||||||
//
|
//
|
||||||
if (LBA == 0 && (IdeBlkIoDevice->Cache == NULL)) {
|
if (LBA == 0 && (IdeBlkIoDevice->Cache == NULL)) {
|
||||||
IdeBlkIoDevice->Cache = AllocatePool (BlockSize);
|
IdeBlkIoDevice->Cache = AllocatePool (BlockSize);
|
||||||
if (IdeBlkIoDevice != NULL) {
|
if (IdeBlkIoDevice->Cache!= NULL) {
|
||||||
CopyMem ((UINT8 *) IdeBlkIoDevice->Cache, (UINT8 *) Buffer, BlockSize);
|
CopyMem ((UINT8 *) IdeBlkIoDevice->Cache, (UINT8 *) Buffer, BlockSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,9 @@ InternalReportStatusCodeEx (
|
|||||||
//
|
//
|
||||||
// Fill in the extended data buffer
|
// Fill in the extended data buffer
|
||||||
//
|
//
|
||||||
CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
|
if (ExtendedData != NULL) {
|
||||||
|
CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Report the status code
|
// Report the status code
|
||||||
|
@ -137,6 +137,9 @@ PciResourceUpdateCheck (
|
|||||||
AcpiPtr = AllocateZeroPool (
|
AcpiPtr = AllocateZeroPool (
|
||||||
sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)
|
sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)
|
||||||
);
|
);
|
||||||
|
if (AcpiPtr == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
OldAcpiPtr = AcpiPtr;
|
OldAcpiPtr = AcpiPtr;
|
||||||
|
|
||||||
@ -255,6 +258,9 @@ PciRegisterUpdateCheck (
|
|||||||
|
|
||||||
Dsc = (EFI_PCI_REGISTER_VALUE_DATA *) (ListPtr + 2);
|
Dsc = (EFI_PCI_REGISTER_VALUE_DATA *) (ListPtr + 2);
|
||||||
RegisterPtr = AllocateZeroPool (sizeof (EFI_PCI_REGISTER_VALUE_DATA));
|
RegisterPtr = AllocateZeroPool (sizeof (EFI_PCI_REGISTER_VALUE_DATA));
|
||||||
|
if (RegisterPtr == NULL) {
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
RegisterPtr->AndValue = Dsc->AndValue;
|
RegisterPtr->AndValue = Dsc->AndValue;
|
||||||
RegisterPtr->OrValue = Dsc->OrValue;
|
RegisterPtr->OrValue = Dsc->OrValue;
|
||||||
@ -356,6 +362,9 @@ PciRegisterAccessCheck (
|
|||||||
if((Dsc->StartOffset <= Offset) && (Dsc->EndOffset > Offset)) {
|
if((Dsc->StartOffset <= Offset) && (Dsc->EndOffset > Offset)) {
|
||||||
|
|
||||||
RegisterPtr = AllocateZeroPool (sizeof (EFI_PCI_REGISTER_ACCESS_DATA));
|
RegisterPtr = AllocateZeroPool (sizeof (EFI_PCI_REGISTER_ACCESS_DATA));
|
||||||
|
if (RegisterPtr == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
RegisterPtr->StartOffset = Dsc->StartOffset;
|
RegisterPtr->StartOffset = Dsc->StartOffset;
|
||||||
RegisterPtr->EndOffset = Dsc->EndOffset;
|
RegisterPtr->EndOffset = Dsc->EndOffset;
|
||||||
|
@ -471,7 +471,9 @@ ReportStatusCodeEx (
|
|||||||
ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
|
ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
|
||||||
}
|
}
|
||||||
CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
|
CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
|
||||||
CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
|
if (ExtendedData != NULL) {
|
||||||
|
CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
|
||||||
|
}
|
||||||
if (CallerId == NULL) {
|
if (CallerId == NULL) {
|
||||||
CallerId = &gEfiCallerIdGuid;
|
CallerId = &gEfiCallerIdGuid;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,9 @@ InternalReportStatusCodeEx (
|
|||||||
//
|
//
|
||||||
// Fill in the extended data buffer
|
// Fill in the extended data buffer
|
||||||
//
|
//
|
||||||
CopyMem (mStatusCodeData + 1, ExtendedData, ExtendedDataSize);
|
if (ExtendedData != NULL) {
|
||||||
|
CopyMem (mStatusCodeData + 1, ExtendedData, ExtendedDataSize);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Report the status code
|
// Report the status code
|
||||||
|
Loading…
x
Reference in New Issue
Block a user