qcacmn: Fix division by 0 in dp_get_kbps_to_mcs
For cases DP_11B_CCK_RATE, DP_11A_OFDM_RATE and DP_11G_CCK_OFDM_RATE, variable num_mcs is not set and is assigned 0 which is used as a divisor to get the MCS value. To fix this, return 0 for above mentioned cases. Change-Id: Ic1d2dce93a3aa55c323e1f75d30c5f9371822280 CRs-Fixed: 3479813
This commit is contained in:

committed by
Madan Koyyalamudi

parent
31ed81c9f7
commit
3c19803152
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2019, 2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2019, 2021 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -7011,21 +7011,14 @@ int dp_get_kbps_to_mcs(int kbps_rate, int shortgi, int htflag)
|
|||||||
switch (htflag) {
|
switch (htflag) {
|
||||||
/* 11b CCK Rates */
|
/* 11b CCK Rates */
|
||||||
case DP_11B_CCK_RATE:
|
case DP_11B_CCK_RATE:
|
||||||
start_index = CCK_RATE_TABLE_INDEX;
|
fallthrough;
|
||||||
end_index = CCK_RATE_TABLE_END_INDEX;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* 11a OFDM Rates */
|
/* 11a OFDM Rates */
|
||||||
case DP_11A_OFDM_RATE:
|
case DP_11A_OFDM_RATE:
|
||||||
start_index = OFDM_RATE_TABLE_INDEX;
|
fallthrough;
|
||||||
end_index = OFDMA_RATE_TABLE_END_INDEX;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* 11g CCK/OFDM Rates */
|
/* 11g CCK/OFDM Rates */
|
||||||
case DP_11G_CCK_OFDM_RATE:
|
case DP_11G_CCK_OFDM_RATE:
|
||||||
start_index = CCK_RATE_TABLE_INDEX;
|
/* These rates dont have corresponding MCS, hence return 0 */
|
||||||
end_index = OFDMA_RATE_TABLE_END_INDEX;
|
return 0;
|
||||||
break;
|
|
||||||
|
|
||||||
/* HT rates only */
|
/* HT rates only */
|
||||||
case DP_HT_RATE:
|
case DP_HT_RATE:
|
||||||
|
Reference in New Issue
Block a user