qcacld-3.0: Initialize sap max number of peers

Currently callers are calling the wlan_mlme_get_sap_max_peers() API
to get the max number of peers without initializing the output
parameter.
In case of failure in wlan_mlme_get_sap_max_peers() API,
sap_max_num_peers can have uninitialized value which can lead to
undefined behavior.

To fix this issue, initialize the output parameter before calling
wlan_mlme_get_sap_max_peers()

CRs-Fixed: 3337315
Change-Id: I83ecaf80ccee7d92a66fe561c0a1a7bd409fd64c
This commit is contained in:
Sachin Ahuja
2022-11-15 17:02:18 +05:30
committed by Madan Koyyalamudi
parent c3b6c10ab4
commit 6b6b2f4fde
3 changed files with 3 additions and 3 deletions

View File

@@ -206,7 +206,7 @@ ucfg_twt_get_all_peer_session_params(struct wlan_objmgr_psoc *psoc_obj,
struct peer_mc_cp_stats *mc_cp_stats;
int num_twt_session = 0;
enum QDF_OPMODE opmode;
int sap_max_peer;
int sap_max_peer = 0;
if (!psoc_obj) {
cp_stats_err("psoc is NULL");