PERFORCE change 135694 for review

Andrew Thompson thompsa at FreeBSD.org
Tue Feb 19 01:57:35 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=135694

Change 135694 by thompsa at thompsa_heff on 2008/02/19 01:57:33

	MF //depot/user/benjsc/wpi/sys/dev/wpi/if_wpi.c at 130843
	
	Fix locking in wpi_init.

Affected files ...

.. //depot/projects/wifi/sys/dev/wpi/if_wpi.c#10 edit

Differences ...

==== //depot/projects/wifi/sys/dev/wpi/if_wpi.c#10 (text+ko) ====

@@ -3157,10 +3157,10 @@
 	WPI_WRITE(sc, WPI_UCODE_CLR, WPI_RADIO_OFF);
 	WPI_WRITE(sc, WPI_UCODE_CLR, WPI_RADIO_OFF);
 
-	if ((error = wpi_load_firmware(sc)) != 0) {
+	if ((wpi_load_firmware(sc)) != 0) {
 	    device_printf(sc->sc_dev,
 		"A problem occurred loading the firmware to the driver\n");
-	    return;
+	    goto fail;
 	}
 
 	/* At this point the firmware is up and running. If the hardware
@@ -3177,7 +3177,7 @@
 		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 		ifp->if_drv_flags |= IFF_DRV_RUNNING;
 		device_printf(sc->sc_dev,"Radio Transmitter is switched off\n");
-		return;
+		goto fail;
 	}
 
 	/* wait for thermal sensors to calibrate */
@@ -3190,8 +3190,7 @@
 	if (ntries == 1000) {
 		device_printf(sc->sc_dev,
 		    "timeout waiting for thermal sensors calibration\n");
-		error = ETIMEDOUT;
-		return;
+		goto fail;
 	}
 	DPRINTFN(WPI_DEBUG_TEMP,("temperature %d\n", sc->temp));
 
@@ -3204,6 +3203,10 @@
 		ieee80211_new_state(ic, IEEE80211_S_RUN, -1);
 	else if (ic->ic_roaming != IEEE80211_ROAMING_MANUAL)
 		ieee80211_new_state(ic, IEEE80211_S_SCAN, -1);
+	return;
+
+fail:
+	WPI_UNLOCK(sc);
 }
 
 static void


More information about the p4-projects mailing list