xen/18488-microcode-free-fix.patch

30 lines
1.0 KiB
Diff
Raw Normal View History

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1221569356 -3600
# Node ID f163138e33402ca565d9886df8ecb21e98f77be6
# Parent 879330497672d96ee966c9774d21c437895f6839
x86, microcode: Free microcode_info struct at end of hypercall.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.3.1-testing/xen/arch/x86/microcode.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/microcode.c
+++ xen-3.3.1-testing/xen/arch/x86/microcode.c
@@ -150,10 +150,13 @@ static long do_microcode_update(void *_i
info->error = error;
info->cpu = next_cpu(info->cpu, cpu_online_map);
- if ( info->cpu >= NR_CPUS )
- return info->error;
+ if ( info->cpu < NR_CPUS )
+ return continue_hypercall_on_cpu(info->cpu, do_microcode_update, info);
+
+ error = info->error;
+ xfree(info);
+ return error;
- return continue_hypercall_on_cpu(info->cpu, do_microcode_update, info);
}
int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len)