Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4f74d35 authored by Nickolai Zeldovich's avatar Nickolai Zeldovich Committed by John W. Linville
Browse files

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -4250,9 +4250,11 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
	p->amsdu_enabled = 0;
	p->amsdu_enabled = 0;


	rc = mwl8k_post_cmd(hw, &cmd->header);
	rc = mwl8k_post_cmd(hw, &cmd->header);
	if (!rc)
		rc = p->station_id;
	kfree(cmd);
	kfree(cmd);


	return rc ? rc : p->station_id;
	return rc;
}
}


static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw,
static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw,