From: Thomas Meyer <thomas@m3y3r.de>
To: herrmann.der.user@googlemail.com, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
amd64-microcode@amd64.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86, microcode, AMD: Cocci spatch "memdup.spatch"
Date: Sat, 01 Jun 2013 11:42:11 +0200 [thread overview]
Message-ID: <1370079731.29224.12.camel@localhost.localdomain> (raw)
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -345,7 +345,7 @@ static int verify_and_add_patch(unsigned
return -EINVAL;
}
- patch->data = kzalloc(patch_size, GFP_KERNEL);
+ patch->data = kmemdup(fw + SECTION_HDR_SIZE, patch_size, GFP_KERNEL);
if (!patch->data) {
pr_err("Patch data allocation failure.\n");
kfree(patch);
@@ -353,7 +353,6 @@ static int verify_and_add_patch(unsigned
}
/* All looks ok, copy patch... */
- memcpy(patch->data, fw + SECTION_HDR_SIZE, patch_size);
INIT_LIST_HEAD(&patch->plist);
patch->patch_id = mc_hdr->patch_id;
patch->equiv_cpu = proc_id;
next reply other threads:[~2013-06-01 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-01 9:42 Thomas Meyer [this message]
2013-06-02 10:21 ` [PATCH] x86, microcode, AMD: Cocci spatch "memdup.spatch" Borislav Petkov
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-all 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=1370079731.29224.12.camel@localhost.localdomain \
--to=thomas@m3y3r.de \
--cc=amd64-microcode@amd64.org \
--cc=herrmann.der.user@googlemail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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