summaryrefslogtreecommitdiffstats
path: root/hci/src
diff options
context:
space:
mode:
authorvenkata Jagadeesh <vjagad@codeaurora.org>2015-09-23 13:19:24 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:17 -0600
commit2f92ec14074acd509c6e6b574744fa0c9591829a (patch)
tree3284e8ad9be39a7f40d064583cc217359b830a34 /hci/src
parent3816d82cc39a826fb40339236907ec863574d19b (diff)
downloadandroid_system_bt-2f92ec14074acd509c6e6b574744fa0c9591829a.tar.gz
android_system_bt-2f92ec14074acd509c6e6b574744fa0c9591829a.tar.bz2
android_system_bt-2f92ec14074acd509c6e6b574744fa0c9591829a.zip
Bluetooth: Added null check for startup_future
startup_timer_expired triggered and makes startup_future null before firmware_config_callback as transport initialization took more time. Added safety check for startup_future to handle such cases Change-Id: I9dc52843b6eadf68411755e34af6709d60352776 CRs-Fixed: 912032
Diffstat (limited to 'hci/src')
-rw-r--r--hci/src/hci_layer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hci/src/hci_layer.c b/hci/src/hci_layer.c
index c26e3db98..5c5a908fe 100644
--- a/hci/src/hci_layer.c
+++ b/hci/src/hci_layer.c
@@ -410,13 +410,15 @@ static void firmware_config_callback(UNUSED_ATTR bool success) {
firmware_is_configured = true;
non_repeating_timer_cancel(startup_timer);
- future_ready(startup_future, FUTURE_SUCCESS);
+ if (startup_future)
+ future_ready(startup_future, FUTURE_SUCCESS);
startup_future = NULL;
}
static void startup_timer_expired(UNUSED_ATTR void *context) {
LOG_ERROR("%s", __func__);
- future_ready(startup_future, FUTURE_FAIL);
+ if (startup_future)
+ future_ready(startup_future, FUTURE_FAIL);
startup_future = NULL;
}