Module Name:    src
Committed By:   macallan
Date:           Tue Jul 30 19:16:50 UTC 2013

Modified Files:
        src/sys/arch/sparc64/dev: ffb.c

Log Message:
avoid uninitialized use of defattr


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc64/dev/ffb.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/sparc64/dev/ffb.c
diff -u src/sys/arch/sparc64/dev/ffb.c:1.52 src/sys/arch/sparc64/dev/ffb.c:1.53
--- src/sys/arch/sparc64/dev/ffb.c:1.52	Thu Aug  9 00:48:06 2012
+++ src/sys/arch/sparc64/dev/ffb.c	Tue Jul 30 19:16:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffb.c,v 1.52 2012/08/09 00:48:06 macallan Exp $	*/
+/*	$NetBSD: ffb.c,v 1.53 2013/07/30 19:16:50 macallan Exp $	*/
 /*	$OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.52 2012/08/09 00:48:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.53 2013/07/30 19:16:50 macallan Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -339,6 +339,7 @@ ffb_attach(device_t self)
 
 	vcons_init(&sc->vd, sc, &ffb_stdscreen, &ffb_accessops);
 	sc->vd.init_screen = ffb_init_screen;
+	ri = &ffb_console_screen.scr_ri;
 
 	/* we mess with ffb_console_screen only once */
 	if (sc->sc_console) {
@@ -354,9 +355,9 @@ ffb_attach(device_t self)
 		if (ffb_console_screen.scr_ri.ri_rows == 0) {
 			/* do some minimal setup to avoid weirdnesses later */
 			vcons_init_screen(&sc->vd, &ffb_console_screen, 1, &defattr);
-		}
+		} else
+			(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
 	}
-	ri = &ffb_console_screen.scr_ri;
 
 	ffb_stdscreen.nrows = ri->ri_rows;
 	ffb_stdscreen.ncols = ri->ri_cols;

Reply via email to