diff options
author | Sara Sharon <sara.sharon@intel.com> | 2019-01-21 12:22:21 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-02-08 13:51:50 +0100 |
commit | a3584f56de1c808d4383a275b4a74467b19e5645 (patch) | |
tree | 940309fe34cc6be5288298610121a0ca02926844 /net/wireless/core.h | |
parent | 1c8745f3ec6f46f5fa99dbcdf92381144ae1b37f (diff) |
cfg80211: Properly track transmitting and non-transmitting BSS
When holding data of the non-transmitting BSS, we need to keep the
transmitting BSS data on. Otherwise it will be released, and release
the non-transmitting BSS with it.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.h')
-rw-r--r-- | net/wireless/core.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h index a50b92ac77a1..c20c75df60f5 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h @@ -153,6 +153,7 @@ struct cfg80211_internal_bss { struct list_head list; struct list_head hidden_list; struct list_head nontrans_list; + struct cfg80211_bss *transmitted_bss; struct rb_node rbn; u64 ts_boottime; unsigned long ts; @@ -183,12 +184,23 @@ static inline struct cfg80211_internal_bss *bss_from_pub(struct cfg80211_bss *pu static inline void cfg80211_hold_bss(struct cfg80211_internal_bss *bss) { atomic_inc(&bss->hold); + if (bss->transmitted_bss) { + bss = container_of(bss->transmitted_bss, + struct cfg80211_internal_bss, pub); + atomic_inc(&bss->hold); + } } static inline void cfg80211_unhold_bss(struct cfg80211_internal_bss *bss) { int r = atomic_dec_return(&bss->hold); WARN_ON(r < 0); + if (bss->transmitted_bss) { + bss = container_of(bss->transmitted_bss, + struct cfg80211_internal_bss, pub); + r = atomic_dec_return(&bss->hold); + WARN_ON(r < 0); + } } |