This problem only affects v4.17+ kernels. Filing for tracking purposes.
Reported by Coverity:
*** CID 1435448: Incorrect expression (SIZEOF_MISMATCH)
/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c: 1010 in iwl_parse_nvm_mcc_info()
1004
1005 for (i = 0; i < regd->n_reg_rules; i++) {
1006 if (!regd->reg_rules[i].wmm_rule)
1007 continue;
1008
1009 copy_rd->reg_rules[i].wmm_rule = d_wmm +
>>> CID 1435448: Incorrect expression (SIZEOF_MISMATCH)
>>> Pointer differences, such as "regd->reg_rules[i].wmm_rule - s_wmm", are automatically scaled down by the size (64 bytes) of
+the pointed-to type ("struct ieee80211_wmm_rule"). Most likely, the division by "sizeof (struct ieee80211_wmm_rule)" is extraneous
+and should be eliminated.
1010 (regd->reg_rules[i].wmm_rule - s_wmm) /
1011 sizeof(struct ieee80211_wmm_rule);
1012 }
1013
1014 out:
1015 kfree(regdb_ptrs);
1016 kfree(regd);
1017 return copy_rd;
1018 }
The same problem applies to iwl7000 (around line 1042 in chromeos-4.14).
Comment 1 by dtapu...@chromium.org
, Jun 8 2018