linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mpc832x_rdb.c: prevent using uninitialized variable
@ 2007-07-26 14:01 Anton Vorontsov
  2007-07-26 16:48 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Vorontsov @ 2007-07-26 14:01 UTC (permalink / raw)
  To: linuxppc-dev

If CONFIG_PCI undefined, np will be used uninitialized, thereby
find_node_by_name(np, "par_io") will fail.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/platforms/83xx/mpc832x_rdb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index c5463c7..b16dce2 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -79,14 +79,14 @@ device_initcall(mpc83xx_spi_devices_init);
 static void __init mpc832x_rdb_setup_arch(void)
 {
 #if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
-	struct device_node *np;
+	struct device_node *np = NULL;
 #endif
 
 	if (ppc_md.progress)
 		ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+	for (; (np = of_find_node_by_type(np, "pci")) != NULL;)
 		mpc83xx_add_bridge(np);
 
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
-- 
1.5.0.6

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

end of thread, other threads:[~2007-07-27 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26 14:01 [PATCH] mpc832x_rdb.c: prevent using uninitialized variable Anton Vorontsov
2007-07-26 16:48 ` Scott Wood
2007-07-27 10:23   ` Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).