UefiCpuPkg/MicrocodeUpdate: Fix GetImage API

Current GetImage API forgets to return data to caller.

Add code to fix it.

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
This commit is contained in:
Jiewen Yao 2016-11-29 15:54:57 +08:00
parent e50f951286
commit bcc6a38f4c
1 changed files with 10 additions and 0 deletions

View File

@ -255,6 +255,16 @@ MicrocodeRead (
TotalSize = MicrocodeEntryPoint->TotalSize;
}
if (ImageIndex == Count + 1) {
if (*ImageSize < TotalSize) {
*ImageSize = TotalSize;
return EFI_BUFFER_TOO_SMALL;
}
*ImageSize = TotalSize;
CopyMem (Image, MicrocodeEntryPoint, TotalSize);
return EFI_SUCCESS;
}
} else {
//
// It is the padding data between the microcode patches for microcode patches alignment.