summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-09-22 21:25:56 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-09-22 21:25:56 +0000
commit1a854b474b930ebb376a577ebcfc5c1111d2c417 (patch)
tree18d265d94632f941547b5bcd5c686d40bbe2852b /sys/arch/sparc
parent39d21705cd4e1e41c3fa005563d16a1bb2dcb50a (diff)
perevent panic on timeout_add on non-existing timeout.
happens on key press before kbd was attached and after zs has been initialized.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/dev/kbd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/kbd.c b/sys/arch/sparc/dev/kbd.c
index deb336a29c7..c9eb43ace5e 100644
--- a/sys/arch/sparc/dev/kbd.c
+++ b/sys/arch/sparc/dev/kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.c,v 1.13 2001/03/24 11:07:50 ho Exp $ */
+/* $OpenBSD: kbd.c,v 1.14 2001/09/22 21:25:55 mickey Exp $ */
/* $NetBSD: kbd.c,v 1.28 1997/09/13 19:12:18 pk Exp $ */
/*
@@ -398,6 +398,7 @@ u_short kbd_cnv_out __P((u_short));
/* set in kbdattach() */
int kbd_repeat_start;
int kbd_repeat_step;
+int kbd_initialized;
/*
* Attach the console keyboard ASCII (up-link) interface.
@@ -475,6 +476,8 @@ kbdattach(kbd)
}
timeout_set(&kbd_softc.k_repeat_tmo, kbd_repeat, k);
+
+ kbd_initialized = 1;
}
void
@@ -677,6 +680,9 @@ kbd_rint(c)
register struct firm_event *fe;
register int put;
+ if (!kbd_initialized)
+ return;
+
if (k->k_repeating) {
k->k_repeating = 0;
timeout_del(&k->k_repeat_tmo);