Date: Wed, 6 Nov 2013 12:57:01 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257743 - head/sys/dev/usb/wlan Message-ID: <201311061257.rA6Cv1cV076847@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Nov 6 12:57:01 2013 New Revision: 257743 URL: http://svnweb.freebsd.org/changeset/base/257743 Log: Check for "ieee80211_vap_setup()" failure in all USB WLAN drivers. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Nov 6 12:57:01 2013 (r257743) @@ -481,8 +481,13 @@ rsu_vap_create(struct ieee80211com *ic, if (uvp == NULL) return (NULL); vap = &uvp->vap; - ieee80211_vap_setup(ic, vap, name, unit, opmode, - flags, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, opmode, + flags, bssid, mac) != 0) { + /* out of memory */ + free(uvp, M_80211_VAP); + return (NULL); + } /* override state transition machine */ uvp->newstate = vap->iv_newstate; Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_rum.c Wed Nov 6 12:57:01 2013 (r257743) @@ -605,8 +605,13 @@ rum_vap_create(struct ieee80211com *ic, return NULL; vap = &rvp->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(rvp, M_80211_VAP); + return (NULL); + } /* override state transition machine */ rvp->newstate = vap->iv_newstate; Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_run.c Wed Nov 6 12:57:01 2013 (r257743) @@ -804,7 +804,13 @@ run_vap_create(struct ieee80211com *ic, if (rvp == NULL) return (NULL); vap = &rvp->vap; - ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, + opmode, flags, bssid, mac) != 0) { + /* out of memory */ + free(rvp, M_80211_VAP); + return (NULL); + } vap->iv_key_update_begin = run_key_update_begin; vap->iv_key_update_end = run_key_update_end; Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_uath.c Wed Nov 6 12:57:01 2013 (r257743) @@ -1073,8 +1073,13 @@ uath_vap_create(struct ieee80211com *ic, 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; Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_upgt.c Wed Nov 6 12:57:01 2013 (r257743) @@ -1041,8 +1041,13 @@ upgt_vap_create(struct ieee80211com *ic, 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; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_ural.c Wed Nov 6 12:57:01 2013 (r257743) @@ -590,8 +590,13 @@ ural_vap_create(struct ieee80211com *ic, 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; Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_urtw.c Wed Nov 6 12:57:01 2013 (r257743) @@ -1036,8 +1036,13 @@ urtw_vap_create(struct ieee80211com *ic, 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; Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_urtwn.c Wed Nov 6 12:57:01 2013 (r257743) @@ -549,8 +549,13 @@ urtwn_vap_create(struct ieee80211com *ic 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; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Wed Nov 6 11:42:45 2013 (r257742) +++ head/sys/dev/usb/wlan/if_zyd.c Wed Nov 6 12:57:01 2013 (r257743) @@ -489,9 +489,14 @@ zyd_vap_create(struct ieee80211com *ic, if (zvp == NULL) return (NULL); vap = &zvp->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(zvp, M_80211_VAP); + return (NULL); + } /* override state transition machine */ zvp->newstate = vap->iv_newstate;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311061257.rA6Cv1cV076847>