aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjacob.shin@amd.com <jacob.shin@amd.com>2006-04-07 13:49:51 -0400
committerDave Jones <davej@redhat.com>2006-04-10 19:14:33 -0400
commit530515a06f90c0831732709efee4a99497bd2b7c (patch)
tree791d8e7e54e0000d8b4bce057894036162fed3c0
parentb40fc4923ee3352c44ac2c0bd5f4d6018d6c4ad7 (diff)
[CPUFREQ] x86_64: Proper null pointer check in powernow_k8_get
This prevents crashes on dual core system when enough ticks are lost. Replaces earlier patch by me. (Duplicate null data check in powernowk8_get() removed -- davej) arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 6ba497c47df6..30bb6fd5b2b2 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -46,7 +46,7 @@
46 46
47#define PFX "powernow-k8: " 47#define PFX "powernow-k8: "
48#define BFX PFX "BIOS error: " 48#define BFX PFX "BIOS error: "
49#define VERSION "version 1.60.1" 49#define VERSION "version 1.60.2"
50#include "powernow-k8.h" 50#include "powernow-k8.h"
51 51
52/* serialize freq changes */ 52/* serialize freq changes */
@@ -910,6 +910,9 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
910 unsigned int newstate; 910 unsigned int newstate;
911 int ret = -EIO; 911 int ret = -EIO;
912 912
913 if (!data)
914 return -EINVAL;
915
913 /* only run on specific CPU from here on */ 916 /* only run on specific CPU from here on */
914 oldmask = current->cpus_allowed; 917 oldmask = current->cpus_allowed;
915 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 918 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
@@ -969,6 +972,9 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
969{ 972{
970 struct powernow_k8_data *data = powernow_data[pol->cpu]; 973 struct powernow_k8_data *data = powernow_data[pol->cpu];
971 974
975 if (!data)
976 return -EINVAL;
977
972 return cpufreq_frequency_table_verify(pol, data->powernow_table); 978 return cpufreq_frequency_table_verify(pol, data->powernow_table);
973} 979}
974 980