From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:18:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD2F51065670; Mon, 14 Dec 2009 19:18:02 +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 9CC0A8FC14; Mon, 14 Dec 2009 19:18:02 +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 nBEJI2jL035668; Mon, 14 Dec 2009 19:18:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJI2AS035666; Mon, 14 Dec 2009 19:18:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912141918.nBEJI2AS035666@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 14 Dec 2009 19:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200530 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:18:02 -0000 Author: gavin Date: Mon Dec 14 19:18:02 2009 New Revision: 200530 URL: http://svn.freebsd.org/changeset/base/200530 Log: 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 PR, but not the attach failure. PR: kern/139079 Tested by: Steven Noonan Reviewed by: thompsa Approved by: ed (mentor) MFC after: 2 weeks` Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Dec 14 19:08:11 2009 (r200529) +++ head/sys/dev/wpi/if_wpi.c Mon Dec 14 19:18:02 2009 (r200530) @@ -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);