On Thu, Jul 26, 2007 at 11:48:33AM -0500, Scott Wood wrote: > On Thu, Jul 26, 2007 at 06:01:39PM +0400, Anton Vorontsov wrote: > > If CONFIG_PCI undefined, np will be used uninitialized, thereby > > find_node_by_name(np, "par_io") will fail. > > This is the wrong fix -- you should be passing NULL to the par_io call > rather than np. Otherwise, if the par_io is earlier in the tree than the > pci, you won't find it.
Oops. Right you are, thanks! I hope this is proper fix. - - - - From: Anton Vorontsov <[EMAIL PROTECTED]> Subject: [POWERPC] mpc832x_rdb.c: prevent using uninitialized variable If CONFIG_PCI undefined, np will be used uninitialized, thereby find_node_by_name(np, "par_io") will fail. of_find_node_by_name(np, "par_io") isn't used inside loop, thus we can safely pass NULL instead of np. Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]> --- arch/powerpc/platforms/83xx/mpc832x_rdb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index b2b28a4..93ba957 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c @@ -56,7 +56,7 @@ static void __init mpc832x_rdb_setup_arch(void) #ifdef CONFIG_QUICC_ENGINE qe_reset(); - if ((np = of_find_node_by_name(np, "par_io")) != NULL) { + if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) { par_io_init(np); of_node_put(np); -- 1.5.0.6 _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev