summaryrefslogtreecommitdiffstats
path: root/bcmdhd/wifi_hal
diff options
context:
space:
mode:
authorPaul Stewart <pstew@google.com>2015-12-08 07:42:24 -0800
committerandroid-build-merger <android-build-merger@google.com>2015-12-08 07:42:24 -0800
commit075a2c508582773018e098d653a98b3004764922 (patch)
tree6dd20e95f82870642a05b05540957d6294922be8 /bcmdhd/wifi_hal
parent0b49c186f3843084d4cb0f40f4381c94c6b5dd9a (diff)
parent2ce1c4952d871f2baad0bc69dd8500f830f43db4 (diff)
downloadhardware_broadcom_wlan-075a2c508582773018e098d653a98b3004764922.zip
hardware_broadcom_wlan-075a2c508582773018e098d653a98b3004764922.tar.gz
hardware_broadcom_wlan-075a2c508582773018e098d653a98b3004764922.tar.bz2
Fix use-after-free in wifi_cleanup()
am: 2ce1c4952d * commit '2ce1c4952d871f2baad0bc69dd8500f830f43db4': Fix use-after-free in wifi_cleanup()
Diffstat (limited to 'bcmdhd/wifi_hal')
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 28f5565..fdb7d7b 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -335,12 +335,12 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
pthread_mutex_unlock(&info->cb_lock);
cmd->cancel();
pthread_mutex_lock(&info->cb_lock);
- /* release reference added when command is saved */
- cmd->releaseRef();
if (num_cmd == info->num_cmd) {
ALOGI("Cancelling command %p:%s did not work", cmd, (cmd ? cmd->getType(): ""));
bad_commands++;
}
+ /* release reference added when command is saved */
+ cmd->releaseRef();
}
}