From d1f305eccffd981d653c92201e238988fba48266 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Wed, 8 Sep 2021 10:41:55 +0530 Subject: [PATCH] qcacld-3.0: Do not cache connection info for non sta interface Currently driver does not check the mode of the current interface whether it is STA of CLI and it caches the connection info, in this process it allocates the memory to cache he operation, this memory get freed only for station type adapter because of which there is a possibility of memleak for CLI interface. To avoid above issue, add a change to only cache the information STA interface. Change-Id: Ic68d71dfd9887600fe1a287de66d735c2c802491 CRs-Fixed: 3028583 --- core/hdd/src/wlan_hdd_assoc.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 0bd425a06f64..f9bb1f539c33 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1139,14 +1139,21 @@ static void hdd_save_bss_info(struct hdd_adapter *adapter, hdd_sta_ctx->conn_info.conn_flag.vht_op_present = false; } - /* Cleanup already existing he info */ - hdd_cleanup_conn_info(adapter); + /* + * Cache connection info only in case of station + */ - /* Cache last connection info */ - qdf_mem_copy(&hdd_sta_ctx->cache_conn_info, &hdd_sta_ctx->conn_info, - sizeof(hdd_sta_ctx->cache_conn_info)); + if (adapter->device_mode == QDF_STA_MODE) { + /* Cleanup already existing he info */ + hdd_cleanup_conn_info(adapter); - hdd_copy_he_operation(hdd_sta_ctx, roam_info); + /* Cache last connection info */ + qdf_mem_copy(&hdd_sta_ctx->cache_conn_info, + &hdd_sta_ctx->conn_info, + sizeof(hdd_sta_ctx->cache_conn_info)); + + hdd_copy_he_operation(hdd_sta_ctx, roam_info); + } } /**