Module Name:    src
Committed By:   maxv
Date:           Mon Aug 15 08:29:34 UTC 2016

Modified Files:
        src/sys/arch/sparc/stand/ofwboot: loadfile_machdep.c

Log Message:
Uninitialized var, found by brainy; not tested, but obvious enough


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
    src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c
diff -u src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c:1.14 src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c:1.15
--- src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c:1.14	Sun Jun 14 16:20:44 2015
+++ src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c	Mon Aug 15 08:29:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: loadfile_machdep.c,v 1.14 2015/06/14 16:20:44 martin Exp $	*/
+/*	$NetBSD: loadfile_machdep.c,v 1.15 2016/08/15 08:29:34 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -216,6 +216,7 @@ tlb_init_sun4u(void)
 	phandle_t child;
 	phandle_t root;
 	char buf[128];
+	bool foundcpu = false;
 	u_int bootcpu;
 	u_int cpu;
 
@@ -236,10 +237,13 @@ tlb_init_sun4u(void)
 			    sizeof(cpu)) == -1 && _prom_getprop(child, "portid",
 			    &cpu, sizeof(cpu)) == -1)
 				panic("tlb_init: prom_getprop");
+			foundcpu = true;
 			if (cpu == bootcpu)
 				break;
 		}
 	}
+	if (!foundcpu)
+		panic("tlb_init: no cpu found!");
 	if (cpu != bootcpu)
 		panic("tlb_init: no node for bootcpu?!?!");
 	if (_prom_getprop(child, "#dtlb-entries", &dtlb_slot_max,

Reply via email to