1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

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
This commit is contained in:
Jean-Sébastien Pédron 2014-10-04 18:40:40 +00:00
parent b76278407d
commit 0d06446812
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272537

View File

@ -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);