summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/wlan/if_urtw.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/wlan/if_urtw.c')
-rw-r--r--sys/dev/usb/wlan/if_urtw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c
index 184317b..4e16579 100644
--- a/sys/dev/usb/wlan/if_urtw.c
+++ b/sys/dev/usb/wlan/if_urtw.c
@@ -1035,8 +1035,13 @@ urtw_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
return (NULL);
vap = &uvp->vap;
/* enable s/w bmiss handling for sta mode */
- ieee80211_vap_setup(ic, vap, name, unit, opmode,
- flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
+
+ if (ieee80211_vap_setup(ic, vap, name, unit, opmode,
+ flags | IEEE80211_CLONE_NOBEACONS, bssid, mac) != 0) {
+ /* out of memory */
+ free(uvp, M_80211_VAP);
+ return (NULL);
+ }
/* override state transition machine */
uvp->newstate = vap->iv_newstate;
@@ -1761,7 +1766,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0,
else
dur = URTW_ASIFS_TIME + acktime;
}
- *(uint16_t *)wh->i_dur = htole16(dur);
+ USETW(wh->i_dur, dur);
xferlen = m0->m_pkthdr.len;
xferlen += (sc->sc_flags & URTW_RTL8187B) ? (4 * 8) : (4 * 3);
OpenPOWER on IntegriCloud