From 5cbe0dca22a31ea90201e47989df44b124f6f13e Mon Sep 17 00:00:00 2001 From: Ashwin Date: Sun, 20 Sep 2015 10:32:34 -0700 Subject: 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 --- bcmdhd/wifi_hal/wifi_hal.cpp | 6 +++--- 1 file 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++; } } -- cgit v1.1