diff options
Diffstat (limited to 'sys/dev/usb/wlan/if_urtwn.c')
-rw-r--r-- | sys/dev/usb/wlan/if_urtwn.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c index 5f61cde..b8c2406 100644 --- a/sys/dev/usb/wlan/if_urtwn.c +++ b/sys/dev/usb/wlan/if_urtwn.c @@ -547,8 +547,13 @@ urtwn_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; |