diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-06-04 20:01:03 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2015-06-05 11:32:42 -0700 |
commit | 74d118dc34771593b3892d7fb72b5b8e07f4da63 (patch) | |
tree | 99af89436ff233329307333b7da67b58d3a53eb3 /bcmdhd/wifi_hal | |
parent | 3df1ce6069291d0d3264ebcef430e6b3c75e7e14 (diff) | |
download | hardware_broadcom_wlan-74d118dc34771593b3892d7fb72b5b8e07f4da63.zip hardware_broadcom_wlan-74d118dc34771593b3892d7fb72b5b8e07f4da63.tar.gz hardware_broadcom_wlan-74d118dc34771593b3892d7fb72b5b8e07f4da63.tar.bz2 |
Fix a deadlock in wifi_cleanup [DO NOT MERGE]
pthread_mutex isn't re-entrant; and results in a hang
if called second time from the same thread. This change
ensures that it is locked only once.
Bug: 21627368
Change-Id: I9c28c1df240316c2a7eafdefa990b9582bc05a9a
Diffstat (limited to 'bcmdhd/wifi_hal')
-rw-r--r-- | bcmdhd/wifi_hal/wifi_hal.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index f50ec46..d3285fd 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -282,7 +282,9 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; if (cmd != NULL) { cmd->addRef(); + pthread_mutex_unlock(&info->cb_lock); cmd->cancel(); + pthread_mutex_lock(&info->cb_lock); cmd->releaseRef(); } } |