From 4c3757679e0d9a7ef4855d4763091b0d01c38fbd Mon Sep 17 00:00:00 2001 From: dumbbell Date: Tue, 14 Oct 2014 19:10:00 +0000 Subject: [PATCH] vt(4): Don't recalculate buffer size if we don't know screen size MF10: r273037 MFC: r272537 When the screen size is unknown, it's set to 0x0. We can't use that as the buffer size, otherwise, functions such as vtbuf_fill() will fail. This fixes a panic on RaspberryPi, where there's no vt(4) backend configured early in boot. PR: 193981 Tested by: danilo@ Approved by: re (marius) git-svn-id: svn://svn.freebsd.org/base/releng/10.1@273104 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/vt/vt_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 2dd7e3f13..67d43489e 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1269,7 +1269,8 @@ vtterm_cnprobe(struct terminal *tm, struct consdev *cp) * that we have the real viewable size, fix it in the static * buffer. */ - vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); + if (vd->vd_width != 0 && vd->vd_height != 0) + vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); -- 2.45.0