diff options
| author | Johannes Berg <[email protected]> | 2023-03-14 17:49:32 +0000 |
|---|---|---|
| committer | Johannes Berg <[email protected]> | 2023-03-15 12:25:15 +0000 |
| commit | 71a54f7e74488f234fb56270253bcd08a3357d0e (patch) | |
| tree | f92461d9cf486f5f85ae09970e47eef6c3a05bbd /drivers/net/wireless/intel/iwlwifi/mvm/rs.c | |
| parent | wifi: iwlwifi: Replace space with tabs as code indent (diff) | |
| download | kernel-71a54f7e74488f234fb56270253bcd08a3357d0e.tar.gz kernel-71a54f7e74488f234fb56270253bcd08a3357d0e.zip | |
wifi: iwlwifi: mvm: rs: print BAD_RATE for invalid HT/VHT index
If there's a rate->index that maps inside the range but
to an uninitialized value, then that's also a bad rate,
avoid printing "(nil)" in that case and rather print the
"BAD_RATE" string instead as in the else branch.
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
Link: https://lore.kernel.org/r/20230314194113.06b38d160fc5.I45a9254d3658b1ce796aa4c427193d3cbf638d7e@changeid
Signed-off-by: Johannes Berg <[email protected]>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/rs.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c index 7c976b7f1cd7..bd135b7168cb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c @@ -512,10 +512,10 @@ static char *rs_pretty_rate(const struct rs_rate *rate) (rate->index <= IWL_RATE_MCS_9_INDEX)) rate_str = ht_vht_rates[rate->index]; else - rate_str = "BAD_RATE"; + rate_str = NULL; sprintf(buf, "(%s|%s|%s)", rs_pretty_lq_type(rate->type), - iwl_rs_pretty_ant(rate->ant), rate_str); + iwl_rs_pretty_ant(rate->ant), rate_str ?: "BAD_RATE"); return buf; } |
