Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2966c6a03efd90197582eae8590d82c789475680
Commit:     2966c6a03efd90197582eae8590d82c789475680
Parent:     95b08679963c78ce0d675224a6efdb5169f2bf75
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 11 14:02:11 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Sep 12 09:28:06 2007 -0700

    x86_64: Prevent doing anything from cache_remove_dev() when info setup 
failed.
    
    AK: Removed the unlikelies because gcc heuristics default to unlikely
    AK: for test == NULL and for negative returns.
    
    Cc: Venkatesh Pallipadi <[EMAIL PROTECTED]>
    Cc: Ashok Raj <[EMAIL PROTECTED]>
    Cc: Akinobu Mita <[EMAIL PROTECTED]>
    Signed-off-by: Jan Beulich <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/intel_cacheinfo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c 
b/arch/i386/kernel/cpu/intel_cacheinfo.c
index d5a456d..db6c25a 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -515,7 +515,7 @@ static int __cpuinit detect_cache_attributes(unsigned int 
cpu)
 
        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(struct sys_device * 
sys_dev)
        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 git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to