diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-07-28 10:33:27 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2015-07-28 10:33:27 -0700 |
commit | 6d9f23bf01b35074e29c6319c4009a1295cb4aa6 (patch) | |
tree | 3287d7307742db94105233030d226b2671df40a2 /bcmdhd | |
parent | 7051193576e886f4b0a14ae7aff8b60d3d726cf4 (diff) | |
download | hardware_broadcom_wlan-6d9f23bf01b35074e29c6319c4009a1295cb4aa6.zip hardware_broadcom_wlan-6d9f23bf01b35074e29c6319c4009a1295cb4aa6.tar.gz hardware_broadcom_wlan-6d9f23bf01b35074e29c6319c4009a1295cb4aa6.tar.bz2 |
Fix a potential crash in debugging code
We want to catch incorrect event_cbs; but the commands
they may refer to may have been deleted by the time
the debugging messages are printed. This change fixes
that by printing before anything is deleted.
Bug: 22401861
Change-Id: I71562af940275b43057eae1f93406291924ad567
Diffstat (limited to 'bcmdhd')
-rw-r--r-- | bcmdhd/wifi_hal/wifi_hal.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 0a6384f..b27bac2 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -295,6 +295,12 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) int bad_commands = 0; + for (int i = 0; i < info->num_event_cb; i++) { + cb_info *cbi = &(info->event_cb[i]); + WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; + ALOGE("Command left in event_cb %p:%s", cmd, cmd->getType()); + } + while (info->num_cmd > bad_commands) { int num_cmd = info->num_cmd; cmd_info *cmdi = &(info->cmd[bad_commands]); @@ -316,7 +322,7 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) for (int i = 0; i < info->num_event_cb; i++) { cb_info *cbi = &(info->event_cb[i]); WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; - ALOGE("Leaked command %p:%s", cmd, cmd->getType()); + ALOGE("Leaked command %p", cmd); } pthread_mutex_unlock(&info->cb_lock); |