public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] arch/i386/kernel/cpu/cpufreq/powernow-k8.c: fix a check-after-use
@ 2006-04-18 22:07 Adrian Bunk
  2006-04-18 22:14 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2006-04-18 22:07 UTC (permalink / raw)
  To: Jacob Shin; +Cc: Dave Jones, Thomas Renninger, Andi Kleen, linux-kernel

This patch fixes a check-after-use introduced by commit 
4211a30349e8d2b724cfb4ce2584604f5e59c299 and spotted by the Coverity 
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 arch/i386/kernel/cpu/cpufreq/powernow-k8.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- linux-2.6.17-rc1-mm3-full/arch/i386/kernel/cpu/cpufreq/powernow-k8.c.old	2006-04-18 20:32:27.000000000 +0200
+++ linux-2.6.17-rc1-mm3-full/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2006-04-18 20:33:02.000000000 +0200
@@ -905,14 +905,17 @@ static int powernowk8_target(struct cpuf
 {
 	cpumask_t oldmask = CPU_MASK_ALL;
 	struct powernow_k8_data *data = powernow_data[pol->cpu];
-	u32 checkfid = data->currfid;
-	u32 checkvid = data->currvid;
+	u32 checkfid;
+	u32 checkvid;
 	unsigned int newstate;
 	int ret = -EIO;
 
 	if (!data)
 		return -EINVAL;
 
+	checkfid = data->currfid;
+	checkvid = data->currvid;
+
 	/* only run on specific CPU from here on */
 	oldmask = current->cpus_allowed;
 	set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2.6 patch] arch/i386/kernel/cpu/cpufreq/powernow-k8.c: fix a check-after-use
  2006-04-18 22:07 [2.6 patch] arch/i386/kernel/cpu/cpufreq/powernow-k8.c: fix a check-after-use Adrian Bunk
@ 2006-04-18 22:14 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2006-04-18 22:14 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Jacob Shin, Dave Jones, Thomas Renninger, linux-kernel

On Wednesday 19 April 2006 00:07, Adrian Bunk wrote:
> This patch fixes a check-after-use introduced by commit 
> 4211a30349e8d2b724cfb4ce2584604f5e59c299 and spotted by the Coverity 
> checker.

Good catch. Should probably go into 2.6.17

-Andi

> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> 
>  arch/i386/kernel/cpu/cpufreq/powernow-k8.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.17-rc1-mm3-full/arch/i386/kernel/cpu/cpufreq/powernow-k8.c.old	2006-04-18 20:32:27.000000000 +0200
> +++ linux-2.6.17-rc1-mm3-full/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2006-04-18 20:33:02.000000000 +0200
> @@ -905,14 +905,17 @@ static int powernowk8_target(struct cpuf
>  {
>  	cpumask_t oldmask = CPU_MASK_ALL;
>  	struct powernow_k8_data *data = powernow_data[pol->cpu];
> -	u32 checkfid = data->currfid;
> -	u32 checkvid = data->currvid;
> +	u32 checkfid;
> +	u32 checkvid;
>  	unsigned int newstate;
>  	int ret = -EIO;
>  
>  	if (!data)
>  		return -EINVAL;
>  
> +	checkfid = data->currfid;
> +	checkvid = data->currvid;
> +
>  	/* only run on specific CPU from here on */
>  	oldmask = current->cpus_allowed;
>  	set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-18 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-18 22:07 [2.6 patch] arch/i386/kernel/cpu/cpufreq/powernow-k8.c: fix a check-after-use Adrian Bunk
2006-04-18 22:14 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox