Pārlūkot izejas kodu

qcacld-3.0: Fix the check for number of arguments in unitTestCmd

In the fix Id1838939813e6cd2d52cee8720a1f4e0ca34329b, the condition to
check the number of args for the command unitTestCmd is set to greater
than equal to, which causes border cases to fail.

Fix the condition to pass correct number of arguments.

Change-Id: I4c6297fb112b4c60a4cb87ffaf0d3999ba798cd9
CRs-Fixed: 2353745
Sourav Mohapatra 6 gadi atpakaļ
vecāks
revīzija
ea7210b5b4
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 1 1
      core/hdd/src/wlan_hdd_wext.c
  2. 1 1
      core/wma/src/wma_main.c

+ 1 - 1
core/hdd/src/wlan_hdd_wext.c

@@ -7441,7 +7441,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 			hdd_err("Invalid MODULE ID %d", apps_args[0]);
 			return -EINVAL;
 		}
-		if ((apps_args[1] >= (WMA_MAX_NUM_ARGS)) ||
+		if ((apps_args[1] > (WMA_MAX_NUM_ARGS)) ||
 		    (apps_args[1] < 0)) {
 			hdd_err("Too Many/Few args %d", apps_args[1]);
 			return -EINVAL;

+ 1 - 1
core/wma/src/wma_main.c

@@ -613,7 +613,7 @@ QDF_STATUS wma_form_unit_test_cmd_and_send(uint32_t vdev_id,
 	QDF_STATUS status;
 
 	WMA_LOGD(FL("enter"));
-	if (arg_count >= WMA_MAX_NUM_ARGS) {
+	if (arg_count > WMA_MAX_NUM_ARGS) {
 		WMA_LOGE(FL("arg_count is crossed the boundary"));
 		return QDF_STATUS_E_FAILURE;
 	}