|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] x86/ucode/AMD: make freeing of old ucode conditional
commit 932f26d9d8825261c5a8c78b113efb6cb2ed2036
Author: Chao Gao <chao.gao@xxxxxxxxx>
AuthorDate: Fri Aug 30 10:22:55 2019 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Aug 30 10:22:55 2019 +0200
x86/ucode/AMD: make freeing of old ucode conditional
It is certain to be NULL at least the first time through.
Reported-by: Sander Eikelenboom <linux@xxxxxxxxxxxxxx>
Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/x86/microcode_amd.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 306978457b..9b743307c4 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -552,9 +552,12 @@ static int cpu_request_microcode(unsigned int cpu, const
void *buf,
mc_old = mc_amd;
}
- xfree(mc_old->mpb);
- xfree(mc_old->equiv_cpu_table);
- xfree(mc_old);
+ if ( mc_old )
+ {
+ xfree(mc_old->mpb);
+ xfree(mc_old->equiv_cpu_table);
+ xfree(mc_old);
+ }
out:
#if CONFIG_HVM
--
generated by git-patchbot for /home/xen/git/xen.git#staging
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |