Skip to content
Commit 973f02c9 authored by Miri Korenblit's avatar Miri Korenblit Committed by Kalle Valo
Browse files

iwlwifi: fix iwl_legacy_rate_to_fw_idx



There are a couple of bugs in this function:

1. It is declared as a non-static function, even though
   it's only used in one file.
2. Its return value should be of type u32 but it returns
   (in some cases) -1.

Fix them by making this function static and returning an
error value of type unsigned.

In addition, we're assigning the return value of this function
as the legacy rate even if the function returned an error value.
Fix this by assigning the lowest rate in this case.

Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Reported-by: default avatarYe Guojin <ye.guojin@zte.com.cn>
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Fixes: 9998f81e ("iwlwifi: mvm: convert old rate & flags to the new format.")
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/iwlwifi.20220128142706.5612eeb9d6d0.I992e10d93fc22919b2bc42daad087ee1b5d6f014@changeid
parent be8287c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment