Skip to content

Commit

Permalink
mac80211: fix bug in ieee80211_build_probe_req
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 9, 2011
1 parent f8d1ccf commit 5b2bbf7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,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;
Expand All @@ -888,6 +890,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;
Expand Down

0 comments on commit 5b2bbf7

Please sign in to comment.