From: "Fan, Jeff" <jeff.fan@intel.com>
To: "Yao, Jiewen" <jiewen.yao@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] UefiCpuPkg/MicrocodeUpdate: Fix GetImage API
Date: Wed, 30 Nov 2016 08:29:56 +0000 [thread overview]
Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4A2EC46E@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1480426299-65308-1-git-send-email-jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
-----Original Message-----
From: Yao, Jiewen
Sent: Tuesday, November 29, 2016 9:32 PM
To: edk2-devel@lists.01.org
Cc: Fan, Jeff
Subject: [PATCH] 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>
---
.../Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 10 ++++++++++
1 file changed, 10 insertions(+)
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.
--
2.7.4.windows.1
prev parent reply other threads:[~2016-11-30 8:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 13:31 [PATCH] UefiCpuPkg/MicrocodeUpdate: Fix GetImage API Jiewen Yao
2016-11-30 8:29 ` Fan, Jeff [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542CF652F8836A4AB8DBFAAD40ED192A4A2EC46E@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox