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

wifi: mac80211: always free sta in __sta_info_alloc in case of error

Free sta pointer in __sta_info_alloc routine if sta_info_alloc_link()
fails.

Fixes: 246b39e4 ("wifi: mac80211: refactor some sta_info link handling")
Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/a3d079208684cddbc25289f7f7e0fed795b0cad4.1661260857.git.lorenzo@kernel.orgSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 60deb9f1
...@@ -494,7 +494,7 @@ __sta_info_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -494,7 +494,7 @@ __sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->sdata = sdata; sta->sdata = sdata;
if (sta_info_alloc_link(local, &sta->deflink, gfp)) if (sta_info_alloc_link(local, &sta->deflink, gfp))
return NULL; goto free;
if (link_id >= 0) { if (link_id >= 0) {
sta_info_add_link(sta, link_id, &sta->deflink, sta_info_add_link(sta, link_id, &sta->deflink,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册