[PATCH] ppx32: Fix uninitialized variable in set_preferred_console

Paul Mackerras paulus at samba.org
Fri May 20 16:45:58 EST 2005


This patch fixes an uninitialized variable warning in
arch/ppc/kernel/setup.c, and this time gcc is actually right, there is
a path that could result in offset being uninitialized.  Zero is a
sane default in this instance.

Signed-off-by: Paul Mackerras <paulus at samba.org>
---

diff -urN linux-2.6/arch/ppc/kernel/setup.c pmac-2.5/arch/ppc/kernel/setup.c
--- linux-2.6/arch/ppc/kernel/setup.c	2005-05-18 10:53:54.000000000 +1000
+++ pmac-2.5/arch/ppc/kernel/setup.c	2005-05-18 14:11:33.000000000 +1000
@@ -499,7 +499,7 @@
 {
 	struct device_node *prom_stdout;
 	char *name;
-	int offset;
+	int offset = 0;
 
 	if (of_stdout_device == NULL)
 		return -ENODEV;



More information about the Linuxppc-dev mailing list