Module Name: src
Committed By: martin
Date: Tue Jan 21 15:44:24 UTC 2020
Modified Files:
src/sys/dev/sun [netbsd-9]: kbd.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #637):
sys/dev/sun/kbd.c: revision 1.71
Fix panic on sun3 when any key is typed when kbd is not console. PR/54873
Should be pulled up to netbsd-9.
To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.69.10.1 src/sys/dev/sun/kbd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.69 src/sys/dev/sun/kbd.c:1.69.10.1
--- src/sys/dev/sun/kbd.c:1.69 Thu Feb 8 10:52:05 2018
+++ src/sys/dev/sun/kbd.c Tue Jan 21 15:44:24 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd.c,v 1.69 2018/02/08 10:52:05 mrg Exp $ */
+/* $NetBSD: kbd.c,v 1.69.10.1 2020/01/21 15:44:24 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.69 2018/02/08 10:52:05 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.69.10.1 2020/01/21 15:44:24 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -202,7 +202,7 @@ kbdopen(dev_t dev, int flags, int mode,
k->k_events.ev_io = l->l_proc;
/* stop pending autorepeat of console input */
- if (k->k_repeating) {
+ if (k->k_cc != NULL && k->k_repeating) {
k->k_repeating = 0;
callout_stop(&k->k_repeat_ch);
}
@@ -492,9 +492,11 @@ kbd_input(struct kbd_softc *k, int code)
/*
* If /dev/kbd is not connected in event mode, or wskbd mode,
- * translate and send upstream (to console).
+ * and is attached as console, translate and send upstream
+ * (to console).
*/
- kbd_input_console(k, code);
+ if (k->k_cc != NULL)
+ kbd_input_console(k, code);
}