From: Guillaume Chazarain <guichaz@yahoo.fr>
To: cpufreq@lists.linux.org.uk
Subject: Uninitialized use of cmd.val in arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:423
Date: Tue, 02 Jan 2007 16:49:17 +0100 [thread overview]
Message-ID: <459A7EFD.2040204@yahoo.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 380 bytes --]
Hi,
In arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:acpi_cpufreq_target()
cmd.val = (cmd.val & ~INTEL_MSR_RANGE) | msr;
cmd.val seems to be used uninitialized. So, one of the attached patch
should be needed. Both patches, and no patch at all, work for me though.
This is linux-2.6.20-rc3 and the code is really executed (I traced it) with
my Pentium M.
Thanks.
--
Guillaume
[-- Attachment #2: acpi-cpufreq-uninitialized-cmd_val1 --]
[-- Type: text/plain, Size: 871 bytes --]
diff -r 90710ed1291f arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c Mon Jan 01 01:00:04 2007 +0000
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c Tue Jan 02 16:26:29 2007 +0100
@@ -372,7 +372,6 @@ static int acpi_cpufreq_target(struct cp
struct cpufreq_freqs freqs;
cpumask_t online_policy_cpus;
struct drv_cmd cmd;
- unsigned int msr;
unsigned int next_state = 0;
unsigned int next_perf_state = 0;
unsigned int i;
@@ -417,10 +416,9 @@ static int acpi_cpufreq_target(struct cp
case SYSTEM_INTEL_MSR_CAPABLE:
cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
cmd.addr.msr.reg = MSR_IA32_PERF_CTL;
- msr =
+ cmd.val =
(u32) perf->states[next_perf_state].
control & INTEL_MSR_RANGE;
- cmd.val = (cmd.val & ~INTEL_MSR_RANGE) | msr;
break;
case SYSTEM_IO_CAPABLE:
cmd.type = SYSTEM_IO_CAPABLE;
[-- Attachment #3: acpi-cpufreq-uninitialized-cmd_val2 --]
[-- Type: text/plain, Size: 506 bytes --]
diff -r 90710ed1291f arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c Mon Jan 01 01:00:04 2007 +0000
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c Tue Jan 02 16:27:47 2007 +0100
@@ -420,6 +420,7 @@ static int acpi_cpufreq_target(struct cp
msr =
(u32) perf->states[next_perf_state].
control & INTEL_MSR_RANGE;
+ cmd.val = get_cur_val(online_policy_cpus);
cmd.val = (cmd.val & ~INTEL_MSR_RANGE) | msr;
break;
case SYSTEM_IO_CAPABLE:
[-- Attachment #4: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
next reply other threads:[~2007-01-02 15:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-02 15:49 Guillaume Chazarain [this message]
2007-01-02 17:57 ` Uninitialized use of cmd.val inarch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:423 Pallipadi, Venkatesh
2007-01-02 18:58 ` [PATCH] Uninitialized use of cmd.val in arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c:acpi_cpufreq_target() Guillaume Chazarain
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=459A7EFD.2040204@yahoo.fr \
--to=guichaz@yahoo.fr \
--cc=cpufreq@lists.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.