diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-06-04 20:01:03 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2015-06-04 20:01:03 -0700 |
commit | 974df1c535fa4aa5c191d47877aa27c79fad0263 (patch) | |
tree | ec531a5bcf201623d08db6044d8f66801b8c8977 /bcmdhd/wifi_hal | |
parent | 79c41bc9ff10a322cf6cacc51b80707d5ba5a4ee (diff) | |
download | hardware_broadcom_wlan-974df1c535fa4aa5c191d47877aa27c79fad0263.zip hardware_broadcom_wlan-974df1c535fa4aa5c191d47877aa27c79fad0263.tar.gz hardware_broadcom_wlan-974df1c535fa4aa5c191d47877aa27c79fad0263.tar.bz2 |
Fix a deadlock in wifi_cleanup
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 03bcc4b..20d2b28 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -283,7 +283,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(); } } |