summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshwin <ashwin.bhat@broadcom.com>2015-09-20 10:32:34 -0700
committerxinhe <xinhe@google.com>2015-09-21 09:49:13 -0700
commit5cbe0dca22a31ea90201e47989df44b124f6f13e (patch)
tree8b7d07ce72506ef6a63b0f76d5820b09c004e8da
parent8fddc3f579d5d641a7c00fbc3b204ce383b55652 (diff)
downloadhardware_broadcom_wlan-5cbe0dca22a31ea90201e47989df44b124f6f13e.zip
hardware_broadcom_wlan-5cbe0dca22a31ea90201e47989df44b124f6f13e.tar.gz
hardware_broadcom_wlan-5cbe0dca22a31ea90201e47989df44b124f6f13e.tar.bz2
Fix crash caused in wifi_cleanup
Check if ptr is NULL before dereferncing in debug print statements. Bug: 24196226 Change-Id: I96e811a1628f4966c9334a83fa3514775d861cf1 Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 00f35d9..28f5565 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -323,7 +323,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("Command left in event_cb %p:%s", cmd, cmd->getType());
+ ALOGI("Command left in event_cb %p:%s", cmd, (cmd ? cmd->getType(): ""));
}
while (info->num_cmd > bad_commands) {
@@ -331,14 +331,14 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
cmd_info *cmdi = &(info->cmd[bad_commands]);
WifiCommand *cmd = cmdi->cmd;
if (cmd != NULL) {
- ALOGD("Cancelling command %p:%s", cmd, cmd->getType());
+ ALOGI("Cancelling command %p:%s", cmd, cmd->getType());
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) {
- ALOGE("Cancelling command %p:%s did not work", cmd, cmd->getType());
+ ALOGI("Cancelling command %p:%s did not work", cmd, (cmd ? cmd->getType(): ""));
bad_commands++;
}
}