x86, mce, AMD: Fix leaving freed data in a list
[pandora-kernel.git] / arch / x86 / kernel / cpu / mcheck / mce_amd.c
index 5bf2fac..bb0adad 100644 (file)
@@ -509,6 +509,7 @@ recurse:
 out_free:
        if (b) {
                kobject_put(&b->kobj);
+               list_del(&b->miscj);
                kfree(b);
        }
        return err;
@@ -527,15 +528,12 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
        int i, err = 0;
        struct threshold_bank *b = NULL;
        char name[32];
-#ifdef CONFIG_SMP
-       struct cpuinfo_x86 *c = &cpu_data(cpu);
-#endif
 
        sprintf(name, "threshold_bank%i", bank);
 
 #ifdef CONFIG_SMP
        if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) {   /* symlink */
-               i = cpumask_first(c->llc_shared_map);
+               i = cpumask_first(cpu_llc_shared_mask(cpu));
 
                /* first core not up yet */
                if (cpu_data(i).cpu_core_id)
@@ -555,7 +553,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
                if (err)
                        goto out;
 
-               cpumask_copy(b->cpus, c->llc_shared_map);
+               cpumask_copy(b->cpus, cpu_llc_shared_mask(cpu));
                per_cpu(threshold_banks, cpu)[bank] = b;
 
                goto out;