diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -274,6 +274,8 @@ SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, &vt_consdev); +static bool inside_vt_flush = false; + /* Initialize locks/mem depended members. */ static void vt_update_static(void *dummy) @@ -1344,6 +1346,9 @@ int cursor_was_shown, cursor_moved; #endif + if (inside_vt_flush && KERNEL_PANICKED()) + return (0); + vw = vd->vd_curwindow; if (vw == NULL) return (0); @@ -1357,6 +1362,8 @@ vtbuf_lock(&vw->vw_buf); + inside_vt_flush = true; + #ifndef SC_NO_CUTPASTE cursor_was_shown = vd->vd_mshown; cursor_moved = (vd->vd_mx != vd->vd_mx_drawn || @@ -1414,10 +1421,12 @@ if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) { vd->vd_driver->vd_bitblt_text(vd, vw, &tarea); + inside_vt_flush = false; vtbuf_unlock(&vw->vw_buf); return (1); } + inside_vt_flush = false; vtbuf_unlock(&vw->vw_buf); return (0); } @@ -1444,6 +1453,9 @@ { struct vt_window *vw = tm->tm_softc; + if (inside_vt_flush && KERNEL_PANICKED()) + return; + vtbuf_lock(&vw->vw_buf); } @@ -1452,6 +1464,9 @@ { struct vt_window *vw = tm->tm_softc; + if (inside_vt_flush && KERNEL_PANICKED()) + return; + vtbuf_unlock(&vw->vw_buf); vt_resume_flush_timer(vw, 0); }