mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
qcacld-3.0: Flush previous cac work before starting a new pre cac
Currently, previous pre_cac work is not being flushed before starting a new pre_cac work. This may result in use after free access if a new pre_cac request comes when cleanup in progress for previous pre_cac work. To avoid this, flush existing pre_cac work before handling a new pre_cac request. Change-Id: I2da535acce8b4a097214597bbc2169ca5521db57 CRs-Fixed: 2841644
This commit is contained in:
parent
1dca6a7813
commit
b537de9650
2 changed files with 8 additions and 3 deletions
|
|
@ -1133,7 +1133,6 @@ static void __wlan_hdd_sap_pre_cac_success(struct hdd_adapter *adapter)
|
|||
return;
|
||||
}
|
||||
|
||||
wlan_hdd_release_intf_addr(hdd_ctx, adapter->mac_addr.bytes);
|
||||
hdd_stop_adapter(hdd_ctx, adapter);
|
||||
|
||||
/* Prepare to switch AP from 2.4GHz channel to the pre CAC channel */
|
||||
|
|
|
|||
|
|
@ -179,6 +179,14 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx,
|
|||
mac_handle_t mac_handle;
|
||||
bool val;
|
||||
|
||||
pre_cac_adapter = hdd_get_adapter_by_iface_name(hdd_ctx,
|
||||
SAP_PRE_CAC_IFNAME);
|
||||
if (pre_cac_adapter) {
|
||||
/* Flush existing pre_cac work */
|
||||
if (hdd_ctx->sap_pre_cac_work.fn)
|
||||
cds_flush_work(&hdd_ctx->sap_pre_cac_work);
|
||||
}
|
||||
|
||||
if (policy_mgr_get_connection_count(hdd_ctx->psoc) > 1) {
|
||||
hdd_err("pre cac not allowed in concurrency");
|
||||
return -EINVAL;
|
||||
|
|
@ -227,8 +235,6 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx,
|
|||
|
||||
hdd_debug("starting pre cac SAP adapter");
|
||||
|
||||
pre_cac_adapter = hdd_get_adapter_by_iface_name(hdd_ctx,
|
||||
SAP_PRE_CAC_IFNAME);
|
||||
if (!pre_cac_adapter) {
|
||||
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_SAP_MODE);
|
||||
if (!mac_addr) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue