diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-11-08 07:04:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-09 14:35:55 -0500 |
commit | 5b2bbf75a24d6b06afff6de0eb4819413fd81971 (patch) | |
tree | 2c48b2fa617f7bc11e9a47c6f40f1a30d1fa83dd /net | |
parent | f8d1ccf15568268c76f913b45ecdd33134387f1a (diff) |
mac80211: fix bug in ieee80211_build_probe_req
ieee80211_probereq_get() can return NULL in
which case we should clean up & return NULL
in ieee80211_build_probe_req() as well.
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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 7439d26bf5f9..0c9490722aa5 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -880,6 +880,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, | |||
880 | skb = ieee80211_probereq_get(&local->hw, &sdata->vif, | 880 | skb = ieee80211_probereq_get(&local->hw, &sdata->vif, |
881 | ssid, ssid_len, | 881 | ssid, ssid_len, |
882 | buf, buf_len); | 882 | buf, buf_len); |
883 | if (!skb) | ||
884 | goto out; | ||
883 | 885 | ||
884 | if (dst) { | 886 | if (dst) { |
885 | mgmt = (struct ieee80211_mgmt *) skb->data; | 887 | mgmt = (struct ieee80211_mgmt *) skb->data; |
@@ -888,6 +890,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, | |||
888 | } | 890 | } |
889 | 891 | ||
890 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; | 892 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; |
893 | |||
894 | out: | ||
891 | kfree(buf); | 895 | kfree(buf); |
892 | 896 | ||
893 | return skb; | 897 | return skb; |