]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cfg80211: remove division by size of sizeof(struct ieee80211_wmm_rule)
authorJohannes Berg <johannes.berg@intel.com>
Mon, 18 Jun 2018 07:29:57 +0000 (09:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:55:51 +0000 (08:55 +0200)
[ Upstream commit 8a54d8fc160e67ad485d95a0322ce1221f80770a ]

Pointer arithmetic already adjusts by the size of the struct,
so the sizeof() calculation is wrong. This is basically the
same as Colin King's patch for similar code in the iwlwifi
driver.

Fixes: 230ebaa189af ("cfg80211: read wmm rules from regulatory database")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/reg.c

index 4fc66a117b7d74f86a1589a7a02b88f02f203b7d..283902974fbfaa803424ddffeb99bd7dba0892d1 100644 (file)
@@ -452,8 +452,7 @@ reg_copy_regd(const struct ieee80211_regdomain *src_regd)
                        continue;
 
                regd->reg_rules[i].wmm_rule = d_wmm +
-                       (src_regd->reg_rules[i].wmm_rule - s_wmm) /
-                       sizeof(struct ieee80211_wmm_rule);
+                       (src_regd->reg_rules[i].wmm_rule - s_wmm);
        }
        return regd;
 }