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
This commit is contained in:
Tushnim Bhattacharyya
2018-05-01 15:18:09 -07:00
committed by nshrivas
parent 0e8a2c6558
commit 46ffb86105

View File

@@ -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",