提交 bcc27fab 编写于 作者: L Lorenzo Bianconi 提交者: Johannes Berg

mac80211: fix possible memory leak in ieee80211_assign_beacon

Free new beacon_data in ieee80211_assign_beacon whenever
ieee80211_assign_beacon fails

Fixes: 8860020e ("cfg80211: restructure AP/GO mode API")
Fixes: bc847970 ("mac80211: support FTM responder configuration/statistic")
Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/770285772543c9fca33777bb4ad4760239e56256.1562105631.git.lorenzo@kernel.orgSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 5edaac06
......@@ -936,8 +936,10 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
err = ieee80211_set_probe_resp(sdata, params->probe_resp,
params->probe_resp_len, csa);
if (err < 0)
if (err < 0) {
kfree(new);
return err;
}
if (err == 0)
changed |= BSS_CHANGED_AP_PROBE_RESP;
......@@ -949,8 +951,10 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
params->civicloc,
params->civicloc_len);
if (err < 0)
if (err < 0) {
kfree(new);
return err;
}
changed |= BSS_CHANGED_FTM_RESPONDER;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册