mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] AMD Microcode: Prefer vzalloc() over calls to vmalloc()+memset()
@ 2010-10-30 19:23 Jesper Juhl
  2010-10-31 10:08 ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Jesper Juhl @ 2010-10-30 19:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Oruba, Andreas Herrmann, amd64-microcode

Hi,

We don't have to do memset() ourselves after vmalloc() when we have 
vzalloc(), so change that in 
arch/x86/kernel/microcode_amd.c::get_next_ucode().

Please CC me on replies.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
compile tested only.

 microcode_amd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index e1af7c0..d46e805 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -183,9 +183,8 @@ get_next_ucode(const u8 *buf, unsigned int size, unsigned int *mc_size)
 		return NULL;
 	}
 
-	mc = vmalloc(UCODE_MAX_SIZE);
+	mc = vzalloc(UCODE_MAX_SIZE);
 	if (mc) {
-		memset(mc, 0, UCODE_MAX_SIZE);
 		if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR,
 				   total_size)) {
 			vfree(mc);


-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-02 17:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 19:23 [PATCH] AMD Microcode: Prefer vzalloc() over calls to vmalloc()+memset() Jesper Juhl
2010-10-31 10:08 ` Borislav Petkov
2010-11-01 19:23   ` Jesper Juhl
2010-11-01 21:27     ` Borislav Petkov
2010-11-01 21:44       ` [PATCH v2] " Jesper Juhl
2010-11-02 17:51         ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®