dect
/
linux-2.6
Archived
13
0
Fork 0

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: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Nickolai Zeldovich 2013-01-06 20:27:22 -05:00 committed by John W. Linville
parent 111b72a2f0
commit c4f74d35ca
1 changed files with 3 additions and 1 deletions

View File

@ -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,