lkml.org 
[lkml]   [2009]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PULL}: latest tip/cpus4096 changes

* Mike Travis <travis@sgi.com> wrote:

> --- a/arch/x86/kernel/microcode_core.c
> +++ b/arch/x86/kernel/microcode_core.c
> @@ -104,7 +104,7 @@ static struct microcode_ops *microcode_ops;
> /* no concurrent ->write()s are allowed on /dev/cpu/microcode */
> static DEFINE_MUTEX(microcode_mutex);
>
> -struct ucode_cpu_info ucode_cpu_info[NR_CPUS];
> +struct ucode_cpu_info *ucode_cpu_info;
> EXPORT_SYMBOL_GPL(ucode_cpu_info);
>
> #ifdef CONFIG_MICROCODE_OLD_INTERFACE
> @@ -471,6 +471,13 @@ static int __init microcode_init(void)
> {
> struct cpuinfo_x86 *c = &cpu_data(0);
> int error;
> + size_t size = sizeof(*ucode_cpu_info) * nr_cpu_ids;
> +
> + ucode_cpu_info = kmalloc(size, GFP_KERNEL);
> + if (!ucode_cpu_info) {
> + WARN(1, "CPU: cannot allocate microcode info structure\n");
> + return -ENOMEM;
> + }
>
> if (c->x86_vendor == X86_VENDOR_INTEL)
> microcode_ops = init_intel_microcode();

look how this code continues:

else if (c->x86_vendor == X86_VENDOR_AMD)
microcode_ops = init_amd_microcode();

if (!microcode_ops) {
printk(KERN_ERR "microcode: no support for this CPU vendor\n");
return -ENODEV;
}

see the memory leak? Again, this patch too is trivially broken.

> commit beec9183a43f8a42f5b790326a3b120a3b513590
> Author: Mike Travis <travis@sgi.com>
> Date: Fri Jan 16 00:22:33 2009 -0800
>
> xen: reduce static memory usage

this one looks good in a quick check but please send it to Jeremy first or
get his Ack.

Ingo


\
 
 \ /
  Last update: 2009-01-16 10:37    [W:0.183 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site