summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Jeon <dennis.jeon@broadcom.corp-partner.google.com>2023-09-12 07:05:44 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-09-12 07:05:44 +0000
commit1ce89f702faf0228507f62d20e91a026d80b67e1 (patch)
tree4b874a1cc00925b9e78571789e671dffa826454a
parent68236de9ae117f14b8068684e90a056cb478cbb3 (diff)
parentb6aef0956eeea5df2573f06b4754b8fbc575d71e (diff)
downloadwlan-1ce89f702faf0228507f62d20e91a026d80b67e1.tar.gz
HAL: Fixed to invalidate global func ptr in clean_up routine am: b6aef0956e
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/broadcom/wlan/+/24687439 Change-Id: Iffd87e82ff3246e4d87001e7c326ba2d124b9f06 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index f746f09..f3039ca 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -608,7 +608,6 @@ static int wifi_add_membership(wifi_handle handle, const char *group)
static void internal_cleaned_up_handler(wifi_handle handle)
{
hal_info *info = getHalInfo(handle);
- wifi_cleaned_up_handler cleaned_up_handler = info->cleaned_up_handler;
ALOGI("internal clean up");
@@ -622,12 +621,6 @@ static void internal_cleaned_up_handler(wifi_handle handle)
info->event_sock = NULL;
}
- if (cleaned_up_handler) {
- ALOGI("cleanup_handler cb");
- (*cleaned_up_handler)(handle);
- } else {
- ALOGI("!! clean up handler is null!!");
- }
DestroyResponseLock();
pthread_mutex_destroy(&info->cb_lock);
free(info);
@@ -641,7 +634,7 @@ void wifi_internal_module_cleanup()
twt_deinit_handler();
}
-void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
+void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler cleaned_up_handler)
{
if (!handle) {
ALOGE("Handle is null");
@@ -655,8 +648,6 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
wifi_interface_handle *ifaceHandles = NULL;
wifi_interface_handle wlan0Handle;
- info->cleaned_up_handler = handler;
-
wlan0Handle = wifi_get_wlan_interface((wifi_handle) info, ifaceHandles, numIfaceHandles);
if (wlan0Handle != NULL) {
@@ -728,6 +719,14 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
info->clean_up = true;
+ /* global func ptr be invalidated and will not call any command from legacy hal */
+ if (cleaned_up_handler) {
+ ALOGI("cleaned_up_handler to invalidates func ptr");
+ cleaned_up_handler(handle);
+ } else {
+ ALOGI("cleaned up handler is null");
+ }
+
if (TEMP_FAILURE_RETRY(write(info->cleanup_socks[0], "Exit", 4)) < 1) {
// As a fallback set the cleanup flag to TRUE
ALOGE("could not write to the cleanup socket");