From b64b200ff83db3a94fe1f8022b6813bff363fb88 Mon Sep 17 00:00:00 2001 From: Devender Kumar Date: Tue, 22 Feb 2022 19:07:09 +0530 Subject: [PATCH] qcacmn: Fix for early free of IPA global varible With multiple radio supporting IPA offload path, the g_ipa_config is getting free when doing wifi unload for single radio, which is leading to an issue of early free of g_ipa_config variable. Fix is check if all the soc are down and then only free the global struct for IPA. Change-Id: If8fbc7a72c91a26e6f9e680711cd58429f8a1e99 CRs-Fixed: 3137091 --- ipa/core/src/wlan_ipa_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ipa/core/src/wlan_ipa_main.c b/ipa/core/src/wlan_ipa_main.c index 3972829b6f..43bd774118 100644 --- a/ipa/core/src/wlan_ipa_main.c +++ b/ipa/core/src/wlan_ipa_main.c @@ -59,13 +59,15 @@ QDF_STATUS ipa_config_mem_alloc(void) void ipa_config_mem_free(void) { - if (!g_ipa_config) { - ipa_err("IPA config already freed"); - return; - } + if (!g_instances_added) { + if (!g_ipa_config) { + ipa_err("IPA config already freed"); + return; + } - qdf_mem_free(g_ipa_config); - g_ipa_config = NULL; + qdf_mem_free(g_ipa_config); + g_ipa_config = NULL; + } } bool ipa_is_hw_support(void)