diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-08-12 15:58:32 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-08-12 15:58:32 +0000 |
commit | 71c1c313d7a054c7699c03b66e1e598b1d7ae5b0 (patch) | |
tree | d17455d7161d214f4928b32f2075317054f5aa49 /sys/dev/ic/vga.c | |
parent | b6c1a50d5d1b9d2bb2a9081166fcae595ab222e6 (diff) |
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.
Diffstat (limited to 'sys/dev/ic/vga.c')
-rw-r--r-- | sys/dev/ic/vga.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index 7e9056f1e0e..a7565f7aa11 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.50 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: vga.c,v 1.51 2009/08/12 15:58:30 miod Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -715,8 +715,10 @@ vga_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(&vc->screens); + scr->pcs.mem = + malloc(scr->pcs.type->ncols * scr->pcs.type->nrows * 2, + M_DEVBUF, M_WAITOK); } scr = malloc(sizeof(struct vgascreen), M_DEVBUF, M_WAITOK); |