提交 c4f74d35 编写于 作者: N Nickolai Zeldovich 提交者: John W. Linville

drivers/net/wireless/mwl8k.c: avoid use-after-free

Do not dereference p->station_id after kfree(cmd) because p
points into the cmd data structure.
Signed-off-by: NNickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 111b72a2
......@@ -4250,9 +4250,11 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
p->amsdu_enabled = 0;
rc = mwl8k_post_cmd(hw, &cmd->header);
if (!rc)
rc = p->station_id;
kfree(cmd);
return rc ? rc : p->station_id;
return rc;
}
static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册