summaryrefslogtreecommitdiff
path: root/qcwcn/wifi_hal/wifi_hal.cpp
diff options
context:
space:
mode:
authorSubhani Shaik <subhanis@codeaurora.org>2016-07-22 19:42:59 +0530
committerEcco Park <eccopark@google.com>2016-07-25 11:34:45 -0700
commit84228ea6c6aaabd4717dc8932f1b0a73b6105d88 (patch)
tree9aeb5dc46426c30f91ffa1e36e2cbbcf675927ee /qcwcn/wifi_hal/wifi_hal.cpp
parent0919dfde526ab1f2996334835cbd176906e89d0e (diff)
downloadwlan-84228ea6c6aaabd4717dc8932f1b0a73b6105d88.tar.gz
WiFi-HAL: Avoid race condition in RSSI monitoring commands/events
There is a possiblility while handling the wlan driver event in the handleEvent of the RssiMonitor, the RssiMonitor stop is also triggered. The stop monitor cleans RssiMonitor command instance. In this case the handleEvent will crash as the object is already deleted. To avoid this scenario moving the handler creation under hal_info and adding checks to ensure that handler is enabled/disabled prior to starting and stopping the monitor command. BUG: 29936203 Change-Id: Id0ab73313a03510f0b15b101e381112c4ace4aef
Diffstat (limited to 'qcwcn/wifi_hal/wifi_hal.cpp')
-rw-r--r--qcwcn/wifi_hal/wifi_hal.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp
index d59d138..2f78718 100644
--- a/qcwcn/wifi_hal/wifi_hal.cpp
+++ b/qcwcn/wifi_hal/wifi_hal.cpp
@@ -560,6 +560,12 @@ wifi_error wifi_initialize(wifi_handle *handle)
goto unload;
}
+ ret = initializeRSSIMonitorHandler(info);
+ if (ret != WIFI_SUCCESS) {
+ ALOGE("Initializing RSSI Event Handler Failed");
+ goto unload;
+ }
+
ALOGV("Initialized Wifi HAL Successfully; vendor cmd = %d Supported"
" features : %x", NL80211_CMD_VENDOR, info->supported_feature_set);
@@ -576,6 +582,7 @@ unload:
if (info->pkt_stats) free(info->pkt_stats);
if (info->rx_aggr_pkts) free(info->rx_aggr_pkts);
cleanupGscanHandlers(info);
+ cleanupRSSIMonitorHandler(info);
free(info);
}
}
@@ -626,6 +633,7 @@ static void internal_cleaned_up_handler(wifi_handle handle)
free(info->rx_aggr_pkts);
wifi_logger_ring_buffers_deinit(info);
cleanupGscanHandlers(info);
+ cleanupRSSIMonitorHandler(info);
if (info->exit_sockets[0] >= 0) {
close(info->exit_sockets[0]);