Browse Source

qcacmn: Resolve coverity issues for operational rate config implementation

Resolve the 'modulo by 0' coverity issue for the implementation for
manual configuration of mcs via "tr069_set_oprate" command.

Change-Id: Iccb29ed0aede59929267dd22e580609c7c853577
CRs-Fixed: 3625355
Ajithkumar Jayamoorthy 1 year ago
parent
commit
f9b6804db1
2 changed files with 3 additions and 2 deletions
  1. 2 2
      dp/cmn_dp_api/dp_ratetable.c
  2. 1 0
      dp/cmn_dp_api/dp_ratetable.h

+ 2 - 2
dp/cmn_dp_api/dp_ratetable.c

@@ -7001,7 +7001,7 @@ qdf_export_symbol(dp_get_supported_rates);
  */
 int dp_get_kbps_to_mcs(int kbps_rate, int shortgi, int htflag)
 {
-	int i = 0, nss = 0, num_mcs = 0;
+	int i = 0, nss = 0, num_mcs = NUM_LEGACY_MCS;
 	int start_index = -1, end_index = -1;
 	int ratekbpssgi = 0, ratekbps = 0;
 
@@ -7144,7 +7144,7 @@ int dp_get_kbps_to_mcs(int kbps_rate, int shortgi, int htflag)
 int dp_get_kbps_to_mcs(int kbps_rate, int shortgi, int htflag,
 		       int nss, int ch_width);
 {
-	int i = 0, num_mcs = 0;
+	int i = 0, num_mcs = NUM_LEGACY_MCS;
 	int start_index = -1, end_index = -1;
 	int ratekbpssgi = 0, ratekbps = 0;
 

+ 1 - 0
dp/cmn_dp_api/dp_ratetable.h

@@ -170,6 +170,7 @@ static inline int dp_ath_rate_out(uint64_t _i)
 #endif
 
 #define INVALID_RATE_ERR -1
+#define NUM_LEGACY_MCS 1
 
 /*
  * The order of the rate types are jumbled below since the current code