The SFI cpufreq driver had a variable that never got initialized, but did get printk'd...
.. which is leaking kernel memory to the user.
Since it's not used... just delete it

Signed-off-by: Arjan van de Ven <[email protected]>

diff --git a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
index 7a1328f..4ccae78 100644
--- a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
@@ -123,12 +123,11 @@ static int sfi_processor_get_performance_states(struct sfi_processor *pr)
             sfi_cpufreq_array[i].latency;
         pr->performance->states[i].control = \
             sfi_cpufreq_array[i].ctrl_val;
- printk(KERN_INFO "State [%d]: core_frequency[%d] transition_latency[%d] control[0x%x] status[0x%x]\n", + printk(KERN_INFO "State [%d]: core_frequency[%d] transition_latency[%d] control[0x%x]\n",
             i,
             (u32) pr->performance->states[i].core_frequency,
             (u32) pr->performance->states[i].transition_latency,
-            (u32) pr->performance->states[i].control,
-            (u32) pr->performance->states[i].status);
+            (u32) pr->performance->states[i].control);
     }

     return result;
@@ -329,7 +328,7 @@ static int sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
         goto err_unreg;
     }

-    data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) *
+    data->freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) *
             (perf->state_count+1), GFP_KERNEL);
     if (!data->freq_table) {
         result = -ENOMEM;
diff --git a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h
index 2ea5a88..7e01c1e 100644
--- a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h
+++ b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h
@@ -48,7 +48,6 @@ struct sfi_processor_px {
     u32 core_frequency;    /* megahertz */
     u32 transition_latency;    /* microseconds */
     u32 control;    /* control value */
-    u32 status;    /* success indicator */
 };

 struct sfi_processor_performance {

diff --git a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c 
b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
index 7a1328f..4ccae78 100644
--- a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
@@ -123,12 +123,11 @@ static int sfi_processor_get_performance_states(struct 
sfi_processor *pr)
                        sfi_cpufreq_array[i].latency;
                pr->performance->states[i].control = \
                        sfi_cpufreq_array[i].ctrl_val;
-               printk(KERN_INFO "State [%d]: core_frequency[%d] 
transition_latency[%d] control[0x%x] status[0x%x]\n",
+               printk(KERN_INFO "State [%d]: core_frequency[%d] 
transition_latency[%d] control[0x%x]\n",
                        i,
                        (u32) pr->performance->states[i].core_frequency,
                        (u32) pr->performance->states[i].transition_latency,
-                       (u32) pr->performance->states[i].control,
-                       (u32) pr->performance->states[i].status);
+                       (u32) pr->performance->states[i].control);
        }
 
        return result;
@@ -329,7 +328,7 @@ static int sfi_cpufreq_cpu_init(struct cpufreq_policy 
*policy)
                goto err_unreg;
        }
 
-       data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) *
+       data->freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) *
                    (perf->state_count+1), GFP_KERNEL);
        if (!data->freq_table) {
                result = -ENOMEM;
diff --git a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h 
b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h
index 2ea5a88..7e01c1e 100644
--- a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h
+++ b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.h
@@ -48,7 +48,6 @@ struct sfi_processor_px {
        u32 core_frequency;     /* megahertz */
        u32 transition_latency; /* microseconds */
        u32 control;    /* control value */
-       u32 status;     /* success indicator */
 };
 
 struct sfi_processor_performance {
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to