summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-02-13 23:36:08 +0000
committerthompsa <thompsa@FreeBSD.org>2009-02-13 23:36:08 +0000
commit5537532d1b2a9b8013d0af30efa778a7bb45f788 (patch)
tree3b0332003e3cfc94f9112805c20e7c27d89cfc39
parent17086da40216ad1f5c3a5e0fcc77629f9b1c15ed (diff)
downloadFreeBSD-src-5537532d1b2a9b8013d0af30efa778a7bb45f788.zip
FreeBSD-src-5537532d1b2a9b8013d0af30efa778a7bb45f788.tar.gz
Since r188030 the error value for attach is returned, this means if kbdmux
fails to attach (possibly due to disable hints) then we get called back for unload. Correctly handle the case where the keyboard isnt found rather than calling panic.
-rw-r--r--sys/dev/kbdmux/kbdmux.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c
index 7a47683..07b592f 100644
--- a/sys/dev/kbdmux/kbdmux.c
+++ b/sys/dev/kbdmux/kbdmux.c
@@ -1346,15 +1346,14 @@ kbdmux_modevent(module_t mod, int type, void *data)
panic("kbd_get_switch(" KEYBOARD_NAME ") == NULL");
kbd = kbd_get_keyboard(kbd_find_keyboard(KEYBOARD_NAME, 0));
- if (kbd == NULL)
- panic("kbd_get_keyboard(kbd_find_keyboard(" KEYBOARD_NAME ", 0)) == NULL");
-
- (*sw->disable)(kbd);
+ if (kbd != NULL) {
+ (*sw->disable)(kbd);
#ifdef KBD_INSTALL_CDEV
- kbd_detach(kbd);
+ kbd_detach(kbd);
#endif
- (*sw->term)(kbd);
- kbd_delete_driver(&kbdmux_kbd_driver);
+ (*sw->term)(kbd);
+ kbd_delete_driver(&kbdmux_kbd_driver);
+ }
error = 0;
break;
OpenPOWER on IntegriCloud