summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Bus
diff options
context:
space:
mode:
authorhfang <hfang@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-23 09:12:51 +0000
committerhfang <hfang@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-23 09:12:51 +0000
commit261136bc32b456800f6dec7eedadea5b2a153eca (patch)
tree648a45a2af0145a301ddeec3e1dca0dce12945f6 /IntelFrameworkModulePkg/Bus
parent3fb46d0b04b82edeee118cb37dc11727d7fa8d8a (diff)
downloadedk2-261136bc32b456800f6dec7eedadea5b2a153eca.zip
edk2-261136bc32b456800f6dec7eedadea5b2a153eca.tar.gz
edk2-261136bc32b456800f6dec7eedadea5b2a153eca.tar.bz2
fix Klocwork issues
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7926 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Bus')
-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
3 files changed, 13 insertions, 5 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
index b09193c..59c4166 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 4a57f11..25ecedb 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 e3515d2..1f989e7 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);
}
}