From 71c1c313d7a054c7699c03b66e1e598b1d7ae5b0 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Wed, 12 Aug 2009 15:58:32 +0000 Subject: Backing store for ega and vga virtual console is not allocated until the second vc is created. However, it was allocated using the geometry of the second vc to allocate backing store for the first. Be sure to use the proper values in case geometries differ. --- sys/dev/isa/ega.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev/isa') diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c index 3fcda238a0f..2790cb02c52 100644 --- a/sys/dev/isa/ega.c +++ b/sys/dev/isa/ega.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ega.c,v 1.13 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: ega.c,v 1.14 2009/08/12 15:58:31 miod Exp $ */ /* $NetBSD: ega.c,v 1.4.4.1 2000/06/30 16:27:47 simonb Exp $ */ /* @@ -622,8 +622,10 @@ ega_alloc_screen(v, type, cookiep, curxp, curyp, defattrp) * for the first one too. * XXX We could be more clever and use video RAM. */ - LIST_FIRST(&vc->screens)->pcs.mem = - malloc(type->ncols * type->nrows * 2, M_DEVBUF, M_WAITOK); + scr = LIST_FIRST(&vs->screens); + scr->pcs.mem = + malloc(scr->pcs.type->ncols * scr->pcs.type->nrows * 2, + M_DEVBUF, M_WAITOK); } scr = malloc(sizeof(struct egascreen), M_DEVBUF, M_WAITOK); -- cgit v1.2.3