Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2008 18:56:53 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 139365 for review
Message-ID:  <200804041856.m34Iurve095350@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=139365

Change 139365 by sam@sam_ebb on 2008/04/04 18:56:32

	handle ieee80211_vap_setup failing

Affected files ...

.. //depot/projects/vap/sys/dev/ath/if_ath.c#59 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/if_ath.c#59 (text+ko) ====

@@ -780,7 +780,7 @@
 	struct ath_vap *avp;
 	struct ieee80211vap *vap;
 	uint8_t mac[IEEE80211_ADDR_LEN];
-	int ic_opmode, needbeacon;
+	int ic_opmode, needbeacon, error;
 
 	avp = (struct ath_vap *) malloc(sizeof(struct ath_vap),
 	    M_80211_VAP, M_WAITOK | M_ZERO);
@@ -865,9 +865,14 @@
 	vap = &avp->av_vap;
 	/* XXX can't hold mutex across if_alloc */
 	ATH_UNLOCK(sc);
-	/* XXX check return */
-	ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);
+	error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags,
+	    bssid, mac);
 	ATH_LOCK(sc);
+	if (error != 0) {
+		device_printf(sc->sc_dev, "%s: error %d creating vap\n",
+		    __func__, error);
+		goto bad2;
+	}
 
 	/* h/w crypto support */
 	vap->iv_key_alloc = ath_key_alloc;
@@ -952,6 +957,9 @@
 	/* complete setup */
 	ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status);
 	return vap;
+bad2:
+	reclaim_address(sc, mac);
+	ath_hal_setbssidmask(sc->sc_ah, sc->sc_hwbssidmask);
 bad:
 	free(avp, M_80211_VAP);
 	ATH_UNLOCK(sc);



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