Fix new Klocwork scanning issues
This patch fixed some new reported klocwork scanning issues. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
parent
aeef6df940
commit
99332b68dc
|
@ -885,7 +885,7 @@ LoadComponentWithCallback (
|
|||
}
|
||||
} else {
|
||||
if (CompressHdr->Size == 0) {
|
||||
Status = EFI_SUCCESS;
|
||||
Status = EFI_BAD_BUFFER_SIZE;
|
||||
} else {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
|
|
@ -748,12 +748,22 @@ Ext2fsOpen (
|
|||
// allocate struct file system specific data structure
|
||||
//
|
||||
Fp = AllocatePool (sizeof (FILE));
|
||||
if (Fp == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto out;
|
||||
}
|
||||
|
||||
SetMem32 (Fp, sizeof (FILE), 0 );
|
||||
File->FileSystemSpecificData = (VOID *)Fp;
|
||||
//
|
||||
// allocate space and read super block
|
||||
//
|
||||
FileSystem = AllocatePool (sizeof (*FileSystem));
|
||||
if (FileSystem == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto out;
|
||||
}
|
||||
|
||||
SetMem32 (FileSystem, sizeof (*FileSystem), 0);
|
||||
Fp->SuperBlockPtr = FileSystem;
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ MmcGetHcPrivateData (
|
|||
Status = GetLibraryData (PcdGet8 (PcdEmmcBlockDeviceLibId), (VOID **)&PrivateData);
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
PrivateData = AllocatePool (sizeof (SD_MMC_HC_PRIVATE_DATA));
|
||||
if (PrivateData != NULL) {
|
||||
ZeroMem (PrivateData, sizeof (SD_MMC_HC_PRIVATE_DATA));
|
||||
if (GetLoaderStage () == LOADER_STAGE_PAYLOAD) {
|
||||
PrivateData->PrivateDataMemType = PayloadMemory;
|
||||
|
@ -39,6 +40,9 @@ MmcGetHcPrivateData (
|
|||
PrivateData->PrivateDataMemType = ReservedMemory;
|
||||
}
|
||||
Status = SetLibraryData (PcdGet8 (PcdEmmcBlockDeviceLibId), PrivateData, sizeof (SD_MMC_HC_PRIVATE_DATA));
|
||||
} else {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
|
Loading…
Reference in New Issue