From owner-svn-src-stable-7@FreeBSD.ORG Mon Feb 16 20:04:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 388BD106566B; Mon, 16 Feb 2009 20:04:58 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2423F8FC24; Mon, 16 Feb 2009 20:04:58 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GK4wVf090682; Mon, 16 Feb 2009 20:04:58 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GK4vwb090681; Mon, 16 Feb 2009 20:04:57 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200902162004.n1GK4vwb090681@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 16 Feb 2009 20:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188696 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/kbdmux X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 20:04:59 -0000 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;