summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2023-04-23 10:29:36 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2023-04-23 10:29:36 +0000
commita05d9192754c34f34495b6e6cdba5e0d5583b3e2 (patch)
tree7fc9e7b911856e942345c81fa574d44b446ade23
parentc0152b7956cf6701acee4977902f41f87531b323 (diff)
Stop setting ri->ri_bs to prevent a panic caused by rasops accessing its
uninitialized content. When we rasops_init() with RI_VCONS, a new screen is allocated. If ri->ri_bs is set, this will be copied. Otherwise a new one will be allocated and filled with ASCII spaces. Copying the ri->ri_bs is useful in case we have an early console which contents we want to keep. As we do not have an early console here, there's no point in setting it at the moment. With this my Hetzner arm64 VM doesn't panic anymore. ok jcs@ kettenis@
-rw-r--r--sys/dev/pv/viogpu.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/pv/viogpu.c b/sys/dev/pv/viogpu.c
index c00a6b395d4..e8a91c34310 100644
--- a/sys/dev/pv/viogpu.c
+++ b/sys/dev/pv/viogpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: viogpu.c,v 1.1 2023/04/20 19:28:31 jcs Exp $ */
+/* $OpenBSD: viogpu.c,v 1.2 2023/04/23 10:29:35 patrick Exp $ */
/*
* Copyright (c) 2021-2023 joshua stein <jcs@openbsd.org>
@@ -92,7 +92,6 @@ struct viogpu_softc {
struct wsscreen_descr sc_wsd;
struct wsscreen_list sc_wsl;
struct wsscreen_descr *sc_scrlist[1];
- struct wsdisplay_charcell sc_fb_bs[VIOGPU_HEIGHT * VIOGPU_WIDTH];
int console;
int primary;
@@ -261,7 +260,6 @@ viogpu_attach(struct device *parent, struct device *self, void *aux)
ri->ri_gnum = 8;
ri->ri_rpos = 16;
ri->ri_rnum = 8;
- ri->ri_bs = sc->sc_fb_bs;
rasops_init(ri, VIOGPU_HEIGHT, VIOGPU_WIDTH);
strlcpy(sc->sc_wsd.name, "std", sizeof(sc->sc_wsd.name));