mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
net80211: amrr_init: change order of commands
First run the KASSERT before trying to do the free operation. Better for reporting and debugging. Add a guard setting the value to NULL afterwards. NULL pointers are a lot easier to test for. Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43751 (cherry picked from commit cd9fee3d2c370e81109505c2abfd381af952e9b3)
This commit is contained in:
parent
fb94767f78
commit
634fd711b0
1 changed files with 2 additions and 1 deletions
|
|
@ -132,8 +132,9 @@ amrr_init(struct ieee80211vap *vap)
|
|||
static void
|
||||
amrr_deinit(struct ieee80211vap *vap)
|
||||
{
|
||||
IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL);
|
||||
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
|
||||
IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL);
|
||||
vap->iv_rs = NULL; /* guard */
|
||||
nrefs--; /* XXX locking */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue