cfg80211: make wmm_rule part of the reg_rule structure

Make wmm_rule be part of the reg_rule structure. This simplifies the
code a lot at the cost of having bigger memory usage. However in most
cases we have only few reg_rule's and when we do have many like in
iwlwifi we do not save memory as it allocates a separate wmm_rule for
each channel anyway.

This also fixes a bug reported in various places where somewhere the
pointers were corrupted and we ended up doing a null-dereference.

Fixes: 230ebaa189 ("cfg80211: read wmm rules from regulatory database")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
[rephrase commit message slightly]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Stanislaw Gruszka
2018-08-22 13:52:21 +02:00
committed by Johannes Berg
parent d7c863a2f6
commit 38cb87ee47
6 changed files with 31 additions and 135 deletions

View File

@@ -4763,8 +4763,8 @@ const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
*
* Return: 0 on success. -ENODATA.
*/
int reg_query_regdb_wmm(char *alpha2, int freq, u32 *ptr,
struct ieee80211_wmm_rule *rule);
int reg_query_regdb_wmm(char *alpha2, int freq,
struct ieee80211_reg_rule *rule);
/*
* callbacks for asynchronous cfg80211 methods, notification