[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    [PATCH] Fix potential NULL pointer
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2003-02-28 23:02:21
[Download RAW message or body]

ChangeSet 1.1022.4.2, 2003/02/28 15:02:21-08:00, mbligh@aracnet.com

	[PATCH] Fix potential NULL pointer
	
	translation_table could be unintialised on machines other than NUMA-Q.
	You never see this, as the compiler happens to optimise it away, but
	it's still a Really Bad Idea (tm). Thanks to someone whose name I have
	unfortunately forgotten for pointing this out.
	
	Has been tested in my tree for over two weeks on UP, SMP, and NUMA and
	compile tested against a variety of different configs.


# This patch includes the following deltas:
#	           ChangeSet	1.1022.4.1 -> 1.1022.4.2
#	arch/i386/kernel/mpparse.c	1.35    -> 1.36   
#	include/asm-i386/mach-numaq/mach_apic.h	1.12    -> 1.12.1.1
#	include/asm-i386/mach-summit/mach_apic.h	1.18    -> 1.18.1.1
#	include/asm-i386/mach-bigsmp/mach_apic.h	1.4     -> 1.4.1.1
#	include/asm-i386/mach-default/mach_apic.h	1.18    -> 1.18.1.1
#

 arch/i386/kernel/mpparse.c                |    2 +-
 include/asm-i386/mach-bigsmp/mach_apic.h  |    3 ++-
 include/asm-i386/mach-default/mach_apic.h |    3 ++-
 include/asm-i386/mach-numaq/mach_apic.h   |    4 +++-
 include/asm-i386/mach-summit/mach_apic.h  |    3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)


diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c	Fri Feb 28 16:07:42 2003
+++ b/arch/i386/kernel/mpparse.c	Fri Feb 28 16:07:42 2003
@@ -110,7 +110,7 @@
 	if (!(m->mpc_cpuflag & CPU_ENABLED))
 		return;
 
-	apicid = mpc_apic_id(m, translation_table[mpc_record]->trans_quad);
+	apicid = mpc_apic_id(m, translation_table[mpc_record]);
 
 	if (m->mpc_featureflag&(1<<0))
 		Dprintk("    Floating point unit present.\n");
diff -Nru a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
--- a/include/asm-i386/mach-bigsmp/mach_apic.h	Fri Feb 28 16:07:42 2003
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h	Fri Feb 28 16:07:42 2003
@@ -87,7 +87,8 @@
        return (int)cpu_2_logical_apicid[cpu];
  }
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
+static inline int mpc_apic_id(struct mpc_config_processor *m,
+			struct mpc_config_translation *translation_record)
 {
 	printk("Processor #%d %ld:%ld APIC version %d\n",
 	        m->mpc_apicid,
diff -Nru a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
--- a/include/asm-i386/mach-default/mach_apic.h	Fri Feb 28 16:07:42 2003
+++ b/include/asm-i386/mach-default/mach_apic.h	Fri Feb 28 16:07:42 2003
@@ -79,7 +79,8 @@
 	return (1ul << phys_apicid);
 }
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
+static inline int mpc_apic_id(struct mpc_config_processor *m, 
+			struct mpc_config_translation *translation_record)
 {
 	printk("Processor #%d %ld:%ld APIC version %d\n",
 			m->mpc_apicid,
diff -Nru a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
--- a/include/asm-i386/mach-numaq/mach_apic.h	Fri Feb 28 16:07:42 2003
+++ b/include/asm-i386/mach-numaq/mach_apic.h	Fri Feb 28 16:07:42 2003
@@ -73,8 +73,10 @@
 	return ( (logical_apicid&0xf) << (4*apicid_to_node(logical_apicid)) );
 }
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
+static inline int mpc_apic_id(struct mpc_config_processor *m, 
+			struct mpc_config_translation *translation_record)
 {
+	int quad = translation_record->trans_quad;
 	int logical_apicid = generate_logical_apicid(quad, m->mpc_apicid);
 
 	printk("Processor #%d %ld:%ld APIC version %d (quad %d, apic %d)\n",
diff -Nru a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
--- a/include/asm-i386/mach-summit/mach_apic.h	Fri Feb 28 16:07:42 2003
+++ b/include/asm-i386/mach-summit/mach_apic.h	Fri Feb 28 16:07:42 2003
@@ -90,7 +90,8 @@
 		return (1ul << apicid);
 }
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
+static inline int mpc_apic_id(struct mpc_config_processor *m, 
+			struct mpc_config_translation *translation_record)
 {
 	printk("Processor #%d %ld:%ld APIC version %d\n",
 			m->mpc_apicid,
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic