Commit e2ef1476 authored by Sharon Dvir's avatar Sharon Dvir Committed by Luca Coelho

iwlwifi: mvm: handle possible BIOS bug

In iwl_mvm_sar_get_ewrd_table() In case of a BIOS bug, n_profiles
might be 0 thus we need to return an error value.  Found by Klocwork.
Signed-off-by: default avatarSharon Dvir <sharon.dvir@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 3287bb10
......@@ -1201,6 +1201,12 @@ static int iwl_mvm_sar_get_ewrd_table(struct iwl_mvm *mvm)
enabled = !!(wifi_pkg->package.elements[1].integer.value);
n_profiles = wifi_pkg->package.elements[2].integer.value;
/* in case of BIOS bug */
if (n_profiles <= 0) {
ret = -EINVAL;
goto out_free;
}
for (i = 0; i < n_profiles; i++) {
/* the tables start at element 3 */
static int pos = 3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment