diff options
author | Srinivas Dasari <dasaris@codeaurora.org> | 2018-03-08 21:05:55 +0530 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2018-03-30 10:52:17 -0700 |
commit | 53d1b8962c4c40ea330794616a7a99ee8d7b5786 (patch) | |
tree | e70373c2362674b53726535cf4426dc12bf82586 /qcwcn/wifi_hal/wifi_hal.cpp | |
parent | e4ef23a12368e12909f9411eae36f833a61c1485 (diff) | |
download | wlan-53d1b8962c4c40ea330794616a7a99ee8d7b5786.tar.gz |
WiFi-Hal: Free event_cb only after deregistering all event handlers
event_cb contains the list of vendor commands registered to
receive events. Deregister all events before flushing
the event_cb.
Bug: 74215851
Change-Id: Ic710f8c3f3c81b11c66855999fc12cbd61b52153
(cherry-picked from 158a66fd427b2116777b5b84f3a0b4d60ca66233)
Diffstat (limited to 'qcwcn/wifi_hal/wifi_hal.cpp')
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index efeed77..050211c 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -698,7 +698,6 @@ unload: nl_socket_free(event_sock); if (info) { if (info->cmd) free(info->cmd); - if (info->event_cb) free(info->event_cb); if (info->cldctx) { cld80211lib_cleanup(info); } else if (info->user_sock) { @@ -708,6 +707,7 @@ unload: if (info->rx_aggr_pkts) free(info->rx_aggr_pkts); cleanupGscanHandlers(info); cleanupRSSIMonitorHandler(info); + free(info->event_cb); free(info); } } @@ -772,9 +772,6 @@ static void internal_cleaned_up_handler(wifi_handle handle) if (info->cmd) free(info->cmd); - if (info->event_cb) - free(info->event_cb); - if (info->cldctx != NULL) { cld80211lib_cleanup(info); } else if (info->user_sock != 0) { @@ -790,6 +787,11 @@ static void internal_cleaned_up_handler(wifi_handle handle) cleanupGscanHandlers(info); cleanupRSSIMonitorHandler(info); + if (info->num_event_cb) + ALOGE("%d events were leftover without being freed", + info->num_event_cb); + free(info->event_cb); + if (info->exit_sockets[0] >= 0) { close(info->exit_sockets[0]); info->exit_sockets[0] = -1; |