Browse Source

qcacmn: Add range check for mode param in cds_get_pcl

Add range check for mode parameter in cds_get_pcl.

Change-Id: I049bebc5ec62f925e164517d59f94d122dbc5dc2
CRs-Fixed: 2234351
Tushnim Bhattacharyya 7 years ago
parent
commit
46ffb86105
1 changed files with 5 additions and 0 deletions
  1. 5 0
      umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

+ 5 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -492,6 +492,11 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc,
 		return status;
 	}
 
+	if (mode >= PM_MAX_NUM_OF_MODE) {
+		policy_mgr_err("requested mode:%d is not supported", mode);
+		return status;
+	}
+
 	/* find the current connection state from pm_conc_connection_list*/
 	num_connections = policy_mgr_get_connection_count(psoc);
 	policy_mgr_debug("connections:%d pref:%d requested mode:%d",