PERFORCE change 139365 for review
Sam Leffler
sam at FreeBSD.org
Fri Apr 4 18:56:54 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=139365
Change 139365 by sam at 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);
More information about the p4-projects
mailing list