qcacld-3.0: Fix WoW Pattern mem leak on unload
WoW patterns are maintained in an internal cache that is not cleaned when the WLAN module is unloaded. Free the WoW pattern cache as part of the WLAN module unload. Change-Id: I1ebd1876555d01551542f7029f53a72af6773dbc CRs-Fixed: 2044774
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||||
*
|
*
|
||||||
@@ -172,12 +172,10 @@ bool hdd_enter_wowl(hdd_adapter_t *pAdapter, bool enable_mp, bool enable_pbm);
|
|||||||
bool hdd_exit_wowl(hdd_adapter_t *pAdapter);
|
bool hdd_exit_wowl(hdd_adapter_t *pAdapter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hdd_init_wowl() - Init function which will initialize the WoWL module
|
* hdd_deinit_wowl() - Deinit function to cleanup WoWL allocated memory
|
||||||
* and perform any required initial configuration
|
|
||||||
* @pAdapter: pointer to the adapter
|
|
||||||
*
|
*
|
||||||
* Return: false if any errors encountered, true otherwise
|
* Return: None
|
||||||
*/
|
*/
|
||||||
bool hdd_init_wowl(hdd_adapter_t *pAdapter);
|
void hdd_deinit_wowl(void);
|
||||||
|
|
||||||
#endif /* #ifndef _WLAN_HDD_WOWL_H */
|
#endif /* #ifndef _WLAN_HDD_WOWL_H */
|
||||||
|
@@ -3735,12 +3735,6 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
|
|||||||
policy_mgr_set_concurrency_mode(hdd_ctx->hdd_psoc,
|
policy_mgr_set_concurrency_mode(hdd_ctx->hdd_psoc,
|
||||||
session_type);
|
session_type);
|
||||||
|
|
||||||
/* Initialize the WoWL service */
|
|
||||||
if (!hdd_init_wowl(adapter)) {
|
|
||||||
hdd_err("hdd_init_wowl failed");
|
|
||||||
goto err_close_adapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Adapter successfully added. Increment the vdev count */
|
/* Adapter successfully added. Increment the vdev count */
|
||||||
hdd_ctx->current_intf_count++;
|
hdd_ctx->current_intf_count++;
|
||||||
|
|
||||||
@@ -3755,8 +3749,6 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
|
|||||||
|
|
||||||
return adapter;
|
return adapter;
|
||||||
|
|
||||||
err_close_adapter:
|
|
||||||
hdd_close_adapter(hdd_ctx, adapter, rtnl_held);
|
|
||||||
err_free_netdev:
|
err_free_netdev:
|
||||||
wlan_hdd_release_intf_addr(hdd_ctx, adapter->macAddressCurrent.bytes);
|
wlan_hdd_release_intf_addr(hdd_ctx, adapter->macAddressCurrent.bytes);
|
||||||
free_netdev(adapter->dev);
|
free_netdev(adapter->dev);
|
||||||
@@ -10213,6 +10205,7 @@ err_out:
|
|||||||
*/
|
*/
|
||||||
void hdd_deinit(void)
|
void hdd_deinit(void)
|
||||||
{
|
{
|
||||||
|
hdd_deinit_wowl();
|
||||||
cds_deinit();
|
cds_deinit();
|
||||||
|
|
||||||
#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
|
#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
|
||||||
|
@@ -539,23 +539,14 @@ bool hdd_exit_wowl(hdd_adapter_t *pAdapter)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void hdd_deinit_wowl(void)
|
||||||
* hdd_init_wowl() - Init function which will initialize the WoWL module
|
|
||||||
* and perform any required initial configuration
|
|
||||||
* @pAdapter: pointer to the adapter
|
|
||||||
*
|
|
||||||
* Return: false if any errors encountered, true otherwise
|
|
||||||
*/
|
|
||||||
bool hdd_init_wowl(hdd_adapter_t *pAdapter)
|
|
||||||
{
|
{
|
||||||
hdd_context_t *pHddCtx = NULL;
|
int i;
|
||||||
pHddCtx = pAdapter->pHddCtx;
|
|
||||||
|
|
||||||
memset(g_hdd_wowl_ptrns, 0, sizeof(g_hdd_wowl_ptrns));
|
for (i = 0; i < WOWL_MAX_PTRNS_ALLOWED; ++i) {
|
||||||
g_hdd_wowl_ptrns_count = 0;
|
if (g_hdd_wowl_ptrns[i]) {
|
||||||
|
qdf_mem_free(g_hdd_wowl_ptrns[i]);
|
||||||
/* Add any statically configured patterns */
|
g_hdd_wowl_ptrns[i] = NULL;
|
||||||
hdd_add_wowl_ptrn(pAdapter, pHddCtx->config->wowlPattern);
|
}
|
||||||
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user