summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Jeon <dennis.jeon@broadcom.corp-partner.google.com>2023-04-14 12:56:43 +0900
committerPaul Chen <chenpaul@google.com>2023-07-21 14:48:29 +0800
commit9ad4903dca9a541ca5c28e95fd7c94222d16de17 (patch)
tree24976ff400ca8ac4858e21407c2b91c21014f8d2
parentbf5e5370050f93f7fabe99dac05ae5fca16db6b0 (diff)
downloadwlan-9ad4903dca9a541ca5c28e95fd7c94222d16de17.tar.gz
HAL: Fixed to protect callback list with mutex in event handler path
Bug: 277347560 Test: halutil Change-Id: I9ccfa128ca76afcf3eaf39f768c7ad9d18b23386 Signed-off-by: Dennis Jeon <dennis.jeon@broadcom.corp-partner.google.com>
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 74e869a..e73a06e 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -710,13 +710,13 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler cleaned_up_handler
ALOGI("Cancelling command %p:%s", cmd, cmd->getType());
pthread_mutex_unlock(&info->cb_lock);
cmd->cancel();
- pthread_mutex_lock(&info->cb_lock);
if (num_cmd == info->num_cmd) {
ALOGI("Cancelling command %p:%s did not work", cmd, (cmd ? cmd->getType(): ""));
bad_commands++;
}
/* release reference added when command is saved */
cmd->releaseRef();
+ pthread_mutex_lock(&info->cb_lock);
}
}
@@ -1098,7 +1098,7 @@ public:
*/
ALOGI("Try to remove event handler if exist, vendor 0x%0x, subcmd 0x%x",
GOOGLE_OUI, GOOGLE_RSSI_MONITOR_EVENT);
- unregisterVendorHandlerWithoutLock(GOOGLE_OUI, GOOGLE_RSSI_MONITOR_EVENT);
+ unregisterVendorHandler(GOOGLE_OUI, GOOGLE_RSSI_MONITOR_EVENT);
ALOGI("SetRSSIMonitorCommand %p destroyed", this);
}