Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 2014 12:22:53 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266466 - head/sys/dev/usb/wlan
Message-ID:  <201405201222.s4KCMrZQ002706@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue May 20 12:22:53 2014
New Revision: 266466
URL: http://svnweb.freebsd.org/changeset/base/266466

Log:
  Make sure detach code is executed in all cases. This fixes a panic
  when debugging is enabled.
  
  Reported by:	Idwer Vollering <vidwer@gmail.com>
  MFC after:	3 days

Modified:
  head/sys/dev/usb/wlan/if_rsu.c

Modified: head/sys/dev/usb/wlan/if_rsu.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rsu.c	Tue May 20 10:28:19 2014	(r266465)
+++ head/sys/dev/usb/wlan/if_rsu.c	Tue May 20 12:22:53 2014	(r266466)
@@ -423,8 +423,6 @@ rsu_detach(device_t self)
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ieee80211com *ic = ifp->if_l2com;
 
-	if (!device_is_attached(self))
-		return (0);
 	rsu_stop(ifp, 1);
 	usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER);
 	ieee80211_ifdetach(ic);
@@ -454,7 +452,7 @@ rsu_do_request(struct rsu_softc *sc, str
 	while (ntries--) {
 		err = usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx,
 		    req, data, 0, NULL, 250 /* ms */);
-		if (err == 0 || !device_is_attached(sc->sc_dev))
+		if (err == 0 || err == USB_ERR_NOT_CONFIGURED)
 			break;
 		DPRINTFN(1, "Control request failed, %s (retrying)\n",
 		    usbd_errstr(err));



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