diff options
author | dumbbell <dumbbell@FreeBSD.org> | 2014-10-04 18:40:40 +0000 |
---|---|---|
committer | dumbbell <dumbbell@FreeBSD.org> | 2014-10-04 18:40:40 +0000 |
commit | fefe763abb3323fa17b43d7048f686eda4b83f83 (patch) | |
tree | 7270821dc292006abd440429e69087714ddeba20 /sys/dev/vt | |
parent | feb6ca868c7a50436e7fd2d5197a655d3026bc56 (diff) | |
download | FreeBSD-src-fefe763abb3323fa17b43d7048f686eda4b83f83.zip FreeBSD-src-fefe763abb3323fa17b43d7048f686eda4b83f83.tar.gz |
vt(4): Don't recalculate buffer size if we don't know screen size
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@
MFC after: 3 days
Diffstat (limited to 'sys/dev/vt')
-rw-r--r-- | sys/dev/vt/vt_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 2dd7e3f..67d4348 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); |