]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/cpu/intel_cacheinfo.c
x86, intel_cacheinfo: fix use-after-free cache_kobject
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / cpu / intel_cacheinfo.c
index 2c8afafa18e860ff98fafb243f2ba7964496c42d..ff517f0b8cc4c1ec8ade88ca534ec929736268a7 100644 (file)
@@ -780,15 +780,14 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
                        }
                        kobject_put(per_cpu(cache_kobject, cpu));
                        cpuid4_cache_sysfs_exit(cpu);
-                       break;
+                       return retval;
                }
                kobject_uevent(&(this_object->kobj), KOBJ_ADD);
        }
-       if (!retval)
-               cpu_set(cpu, cache_dev_map);
+       cpu_set(cpu, cache_dev_map);
 
        kobject_uevent(per_cpu(cache_kobject, cpu), KOBJ_ADD);
-       return retval;
+       return 0;
 }
 
 static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)