[tip:perf/nmi] kernel/watchdog: Initialize 'result'

From: tip-bot for Kulikov Vasiliy
Date: Wed Jul 07 2010 - 04:04:31 EST


Commit-ID: eb703f98191a505f78d0066712ad67d5dedc4c90
Gitweb: http://git.kernel.org/tip/eb703f98191a505f78d0066712ad67d5dedc4c90
Author: Kulikov Vasiliy <segooon@xxxxxxxxx>
AuthorDate: Mon, 5 Jul 2010 12:00:54 +0400
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Wed, 7 Jul 2010 08:46:42 +0200

kernel/watchdog: Initialize 'result'

Variable on the stack is not initialized to zero, do it
explicitly.

This bug was found by a compiler warning:

kernel/watchdog.c:463: warning: 'result' may be used uninitialized in this function

Signed-off-by: Kulikov Vasiliy <segooon@xxxxxxxxx>
Acked-by: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
LKML-Reference: <1278316854-28442-1-git-send-email-segooon@xxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
kernel/watchdog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 91b0b26..613bc1f 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -460,7 +460,7 @@ static void watchdog_disable(int cpu)
static void watchdog_enable_all_cpus(void)
{
int cpu;
- int result;
+ int result = 0;

for_each_online_cpu(cpu)
result += watchdog_enable(cpu);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/