diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 3f3de5188a5..2a8b2d014e5 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -1908,6 +1908,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) { int result; + /* + * XXX Check of someone is calling us from a critical section: + */ + if (curthread->td_critnest != 0) + return (EDEADLK); + /* * XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any * context where printf(9) can be called, which among other things