diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-11-08 13:04:41 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-26 09:09:54 -0800 |
commit | ae1e9df381d5197015356e22de9d7acaf646a9ab (patch) | |
tree | 869e8776944a5635b359e16bbd66d1844fa9c0a9 /net | |
parent | 492d7eff2def54c6e5521ee82764ca22025e7030 (diff) |
mac80211: fix bug in ieee80211_build_probe_req
commit 5b2bbf75a24d6b06afff6de0eb4819413fd81971 upstream.
ieee80211_probereq_get() can return NULL in
which case we should clean up & return NULL
in ieee80211_build_probe_req() as well.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index d3fe2d23748..2124db8e72b 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1047,6 +1047,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, skb = ieee80211_probereq_get(&local->hw, &sdata->vif, ssid, ssid_len, buf, buf_len); + if (!skb) + goto out; if (dst) { mgmt = (struct ieee80211_mgmt *) skb->data; @@ -1055,6 +1057,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, } IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; + + out: kfree(buf); return skb; |