diff options
author | Subhani Shaik <subhanis@codeaurora.org> | 2016-03-24 19:52:11 +0530 |
---|---|---|
committer | mukesh agrawal <quiche@google.com> | 2016-04-13 10:39:38 -0700 |
commit | 42f5dc2b5f632ce601d876fad18830de3ea38b89 (patch) | |
tree | 7ccbdc64fa58567fe643f2e42daa08b66e5df2ab /qcwcn/wifi_hal/wifi_hal.cpp | |
parent | 68519e22a5d46fbd424347da20c9f95dd2f3925d (diff) | |
download | wlan-42f5dc2b5f632ce601d876fad18830de3ea38b89.tar.gz |
WiFi-HAL: Protect packet fate stats resources with mutex
Wifihal collects packet fate stats to a local buffer and the stats
will be copied to the buffers provided by framework in get() APIs.
Protect reads and writes to this buffer with a mutex to avoid
read from get() while write is going on in the event context.
BUG: 27799235
Diffstat (limited to 'qcwcn/wifi_hal/wifi_hal.cpp')
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index 3727e0b..0221e73 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -462,6 +462,7 @@ wifi_error wifi_initialize(wifi_handle *handle) } pthread_mutex_init(&info->cb_lock, NULL); + pthread_mutex_init(&info->pkt_fate_stats_lock, NULL); *handle = (wifi_handle) info; @@ -654,6 +655,7 @@ static void internal_cleaned_up_handler(wifi_handle handle) (*cleaned_up_handler)(handle); pthread_mutex_destroy(&info->cb_lock); + pthread_mutex_destroy(&info->pkt_fate_stats_lock); free(info); ALOGI("Internal cleanup completed"); |