Commit c4f74d35 authored by Nickolai Zeldovich's avatar Nickolai Zeldovich Committed by 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: default avatarNickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment