[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070911120211.1E25F14EEC@wotan.suse.de>
Date: Tue, 11 Sep 2007 14:02:11 +0200 (CEST)
From: Andi Kleen <ak@...e.de>
To: venkatesh.pallipadi@...el.com, ashok.raj@...el.com,
akinobu.mita@...il.com, torvalds@...l.org, patches@...-64.org,
linux-kernel@...r.kernel.org
Subject: [PATCH for 2.6.23] [2/3] x86_64: Prevent doing anything from cache_remove_dev() when info setup failed.
AK: Removed the unlikelies because gcc heuristics default to unlikely for test
AK: == NULL and for negative returns.
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Cc: Ashok Raj <ashok.raj@...el.com>
Cc: Akinobu Mita <akinobu.mita@...il.com>
Signed-off-by: Jan Beulich <jbeulich@...ell.com>
Signed-off-by: Andi Kleen <ak@...e.de>
Index: linux/arch/i386/kernel/cpu/intel_cacheinfo.c
===================================================================
--- linux.orig/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ linux/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -515,7 +515,7 @@ static int __cpuinit detect_cache_attrib
cpuid4_info[cpu] = kzalloc(
sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);
- if (unlikely(cpuid4_info[cpu] == NULL))
+ if (cpuid4_info[cpu] == NULL)
return -ENOMEM;
oldmask = current->cpus_allowed;
@@ -748,6 +748,8 @@ static void __cpuinit cache_remove_dev(s
unsigned int cpu = sys_dev->id;
unsigned long i;
+ if (cpuid4_info[cpu] == NULL)
+ return;
for (i = 0; i < num_cache_leaves; i++) {
cache_remove_shared_cpu_map(cpu, i);
kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists