From owner-svn-src-stable@FreeBSD.ORG Sun Feb 14 09:34:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26F79106566B; Sun, 14 Feb 2010 09:34:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 150CA8FC0C; Sun, 14 Feb 2010 09:34:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1E9YRlm028386; Sun, 14 Feb 2010 09:34:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E9YRRi028384; Sun, 14 Feb 2010 09:34:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002140934.o1E9YRRi028384@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 14 Feb 2010 09:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203855 - stable/8/sys/dev/wpi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 09:34:28 -0000 Author: gavin Date: Sun Feb 14 09:34:27 2010 New Revision: 203855 URL: http://svn.freebsd.org/changeset/base/203855 Log: Merge r200530 from head: Don't panic on failure to attach if we fail before or during the if_alloc() of ifp. This fixes the panic reported in the PRs, but not the attach failure. PR: kern/139079, kern/143874 Tested by: Steven Noonan Reviewed by: thompsa Modified: stable/8/sys/dev/wpi/if_wpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sun Feb 14 07:20:58 2010 (r203854) +++ stable/8/sys/dev/wpi/if_wpi.c Sun Feb 14 09:34:27 2010 (r203855) @@ -713,13 +713,14 @@ wpi_detach(device_t dev) { struct wpi_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; int ac; - ieee80211_draintask(ic, &sc->sc_restarttask); - ieee80211_draintask(ic, &sc->sc_radiotask); - if (ifp != NULL) { + ic = ifp->if_l2com; + + ieee80211_draintask(ic, &sc->sc_restarttask); + ieee80211_draintask(ic, &sc->sc_radiotask); wpi_stop(sc); callout_drain(&sc->watchdog_to); callout_drain(&sc->calib_to);