summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/wlan
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2014-04-24 03:16:47 +0000
committerkevlo <kevlo@FreeBSD.org>2014-04-24 03:16:47 +0000
commit1411f9e891de71a638db5dcc632989c4b28a5ca4 (patch)
tree74b23e1548ee7f06de1cca14122a5c985c80da53 /sys/dev/usb/wlan
parent0c70f2535bbda4a3a831616e33c53d369f369479 (diff)
downloadFreeBSD-src-1411f9e891de71a638db5dcc632989c4b28a5ca4.zip
FreeBSD-src-1411f9e891de71a638db5dcc632989c4b28a5ca4.tar.gz
Fix panic by adding mtx_assert() to urtwn_init_locked() and
urtwn_stop_locked(). Tested by: Anthony Jenkins <scoobi_doo at yahoo dot com>
Diffstat (limited to 'sys/dev/usb/wlan')
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index bde88b0..2a5bfe9 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -2054,6 +2054,7 @@ urtwn_load_firmware(struct urtwn_softc *sc)
uint32_t reg;
int mlen, ntries, page, error;
+ URTWN_UNLOCK(sc);
/* Read firmware image from the filesystem. */
if ((sc->chip & (URTWN_CHIP_UMC_A_CUT | URTWN_CHIP_92C)) ==
URTWN_CHIP_UMC_A_CUT)
@@ -2062,6 +2063,7 @@ urtwn_load_firmware(struct urtwn_softc *sc)
imagename = "urtwn-rtl8192cfwT";
fw = firmware_get(imagename);
+ URTWN_LOCK(sc);
if (fw == NULL) {
device_printf(sc->sc_dev,
"failed loadfirmware of file %s\n", imagename);
@@ -2816,6 +2818,8 @@ urtwn_init_locked(void *arg)
uint32_t reg;
int error;
+ URTWN_ASSERT_LOCKED(sc);
+
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
urtwn_stop_locked(ifp);
@@ -2979,6 +2983,8 @@ urtwn_stop_locked(struct ifnet *ifp)
{
struct urtwn_softc *sc = ifp->if_softc;
+ URTWN_ASSERT_LOCKED(sc);
+
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
callout_stop(&sc->sc_watchdog_ch);
OpenPOWER on IntegriCloud