qcacld-3.0: Clear sap ctx channel list in undo acs
Currently the sap ctx's channel list is not freed as part of undo acs, and hence can lead to mem leak when the do acs and SSR is triggered in parallel. Scenario:- 1. Turn on SAP 2. Do SSR in parallel 3. Unload WLAN Fix is to clear the channel list as part of undo acs. Change-Id: Ie8dcace1d32aeec2621e785d793290d70c194f62 CRs-Fixed: 2511752
Este commit está contenido en:

cometido por
nshrivas

padre
0dc383e4e2
commit
11bc67c606
@@ -3027,28 +3027,9 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
|
||||
void wlan_hdd_undo_acs(struct hdd_adapter *adapter)
|
||||
{
|
||||
struct sap_config *sap_cfg;
|
||||
|
||||
if (!adapter)
|
||||
return;
|
||||
|
||||
sap_cfg = &adapter->session.ap.sap_config;
|
||||
if (sap_cfg->acs_cfg.ch_list) {
|
||||
hdd_debug("Clearing ACS cfg channel list");
|
||||
qdf_mem_free(sap_cfg->acs_cfg.ch_list);
|
||||
sap_cfg->acs_cfg.ch_list = NULL;
|
||||
}
|
||||
if (sap_cfg->acs_cfg.master_ch_list) {
|
||||
hdd_debug("Clearing master ACS cfg channel list");
|
||||
qdf_mem_free(sap_cfg->acs_cfg.master_ch_list);
|
||||
sap_cfg->acs_cfg.master_ch_list = NULL;
|
||||
}
|
||||
sap_cfg->acs_cfg.ch_list_count = 0;
|
||||
sap_cfg->acs_cfg.master_ch_list_count = 0;
|
||||
sap_cfg->acs_cfg.acs_mode = false;
|
||||
sap_undo_acs(WLAN_HDD_GET_SAP_CTX_PTR(adapter));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1322,6 +1322,17 @@ QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
|
||||
struct sap_config *config,
|
||||
void *pusr_context);
|
||||
|
||||
/**
|
||||
* sap_undo_acs() - Undo acs i.e free the allocated ch lists
|
||||
* @sap_ctx: pointer to the SAP context
|
||||
*
|
||||
* This function will free the memory allocated to the sap ctx channel list, acs
|
||||
* cfg ch list and master ch list.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void sap_undo_acs(struct sap_context *sap_context);
|
||||
|
||||
/**
|
||||
* wlansap_get_chan_width() - get sap channel width.
|
||||
* @sap_ctx: pointer to the SAP context
|
||||
|
@@ -2482,6 +2482,38 @@ void wlansap_populate_del_sta_params(const uint8_t *mac,
|
||||
QDF_MAC_ADDR_ARRAY(params->peerMacAddr.bytes));
|
||||
}
|
||||
|
||||
void sap_undo_acs(struct sap_context *sap_ctx)
|
||||
{
|
||||
struct sap_acs_cfg *acs_cfg;
|
||||
|
||||
if (!sap_ctx)
|
||||
return;
|
||||
|
||||
acs_cfg = sap_ctx->acs_cfg;
|
||||
if (!acs_cfg)
|
||||
return;
|
||||
|
||||
if (acs_cfg->ch_list) {
|
||||
sap_debug("Clearing ACS cfg channel list");
|
||||
qdf_mem_free(acs_cfg->ch_list);
|
||||
acs_cfg->ch_list = NULL;
|
||||
}
|
||||
if (acs_cfg->master_ch_list) {
|
||||
sap_debug("Clearing master ACS cfg channel list");
|
||||
qdf_mem_free(acs_cfg->master_ch_list);
|
||||
acs_cfg->master_ch_list = NULL;
|
||||
}
|
||||
if (sap_ctx->freq_list) {
|
||||
sap_debug("Clearing sap context ch freq list");
|
||||
qdf_mem_free(sap_ctx->freq_list);
|
||||
sap_ctx->freq_list = NULL;
|
||||
}
|
||||
acs_cfg->ch_list_count = 0;
|
||||
acs_cfg->master_ch_list_count = 0;
|
||||
acs_cfg->acs_mode = false;
|
||||
sap_ctx->num_of_channel = 0;
|
||||
}
|
||||
|
||||
QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
|
||||
sap_event_cb acs_event_callback,
|
||||
struct sap_config *config,
|
||||
|
Referencia en una nueva incidencia
Block a user