Skip to content

Commit

Permalink
iwlwifi: mvm: fix an out-of-bound access
Browse files Browse the repository at this point in the history
The index for the elements of the ACPI object we dereference
was static. This means that if we called the function twice
we wouldn't start from 3 again, but rather from the latest
index we reached in the previous call.
This was dutifully reported by KASAN.

Fix this.

Cc: stable@vger.kernel.org
Fixes: 6996490 ("iwlwifi: mvm: add support for EWRD (Dynamic SAR) ACPI table")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Emmanuel Grumbach authored and Johannes Berg committed Jul 30, 2019
1 parent 87e7e25 commit ba3224d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlwifi/mvm/fw.c
Original file line number Diff line number Diff line change
@@ -755,7 +755,7 @@ static int iwl_mvm_sar_get_ewrd_table(struct iwl_mvm *mvm)

for (i = 0; i < n_profiles; i++) {
/* the tables start at element 3 */
static int pos = 3;
int pos = 3;

/* The EWRD profiles officially go from 2 to 4, but we
* save them in sar_profiles[1-3] (because we don't

0 comments on commit ba3224d

Please sign in to comment.