mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: venkatesh.pallipadi@intel.com, ashok.raj@intel.com,
	akinobu.mita@gmail.com, torvalds@osdl.org, patches@x86-64.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH for 2.6.23] [2/3] x86_64: Prevent doing anything from cache_remove_dev() when info setup failed.
Date: Tue, 11 Sep 2007 14:02:11 +0200 (CEST)	[thread overview]
Message-ID: <20070911120211.1E25F14EEC@wotan.suse.de> (raw)
In-Reply-To: <20070911202.911586000@suse.de>


AK: Removed the unlikelies because gcc heuristics default to unlikely for test
AK: == NULL and for negative returns.

Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.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));

  parent reply	other threads:[~2007-09-11 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11 12:02 [PATCH for 2.6.23] [0/3] More last minute bug fixes for x86 Andi Kleen
2007-09-11 12:02 ` [PATCH for 2.6.23] [1/3] x86_64: Add missing mask operation to vdso Andi Kleen
2007-09-11 12:02 ` Andi Kleen [this message]
2007-09-13  9:32   ` [PATCH for 2.6.23] [2/3] x86_64: Prevent doing anything from cache_remove_dev() when info setup failed Andi Kleen
2007-09-11 12:02 ` [PATCH for 2.6.23] [3/3] i386: Fix leak of ../kernel from top level Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070911120211.1E25F14EEC@wotan.suse.de \
    --to=ak@suse.de \
    --cc=akinobu.mita@gmail.com \
    --cc=ashok.raj@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@x86-64.org \
    --cc=torvalds@osdl.org \
    --cc=venkatesh.pallipadi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®