svn commit: r188696 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/kbdmux
Maksim Yevmenkin
emax at FreeBSD.org
Mon Feb 16 12:04:59 PST 2009
Author: emax
Date: Mon Feb 16 20:04:57 2009
New Revision: 188696
URL: http://svn.freebsd.org/changeset/base/188696
Log:
MFC r188603
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.
Submitted by: thompsa
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/kbdmux/kbdmux.c
Modified: stable/7/sys/dev/kbdmux/kbdmux.c
==============================================================================
--- stable/7/sys/dev/kbdmux/kbdmux.c Mon Feb 16 19:18:14 2009 (r188695)
+++ stable/7/sys/dev/kbdmux/kbdmux.c Mon Feb 16 20:04:57 2009 (r188696)
@@ -1367,15 +1367,14 @@ kbdmux_modevent(module_t mod, int type,
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;
More information about the svn-src-all
mailing list