diff options
author | Jiewen Yao <jiewen.yao@intel.com> | 2016-11-29 15:54:57 +0800 |
---|---|---|
committer | Jiewen Yao <jiewen.yao@intel.com> | 2016-11-30 20:13:58 +0800 |
commit | bcc6a38f4c2419e704c99fa2d3dc01e1cb007a17 (patch) | |
tree | 45ab6a58b703396909759f7ec7fa69a0c0052cca /UefiCpuPkg/Feature | |
parent | e50f951286d8dbc35404e01dd77b9eacfb16191f (diff) | |
download | edk2-bcc6a38f4c2419e704c99fa2d3dc01e1cb007a17.zip edk2-bcc6a38f4c2419e704c99fa2d3dc01e1cb007a17.tar.gz edk2-bcc6a38f4c2419e704c99fa2d3dc01e1cb007a17.tar.bz2 |
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>
Diffstat (limited to 'UefiCpuPkg/Feature')
-rw-r--r-- | UefiCpuPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c b/UefiCpuPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c index 2b2d3ac..2eb4ae4 100644 --- a/UefiCpuPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c @@ -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.
|