Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 2009 20:04:57 +0000 (UTC)
From:      Maksim Yevmenkin <emax@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188696 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/kbdmux
Message-ID:  <200902162004.n1GK4vwb090681@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902162004.n1GK4vwb090681>