summaryrefslogtreecommitdiffstats
path: root/libbt-vendor
diff options
context:
space:
mode:
authorpramod kotreshappa <kpramod@codeaurora.org>2015-05-12 12:21:28 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-05-14 10:36:43 -0700
commit7e85a75feb8e9d1c32d81c630bfd86d65a6a1d56 (patch)
tree44e9a08099ce4d6d54a4f56c6b0cd5a32a157f2e /libbt-vendor
parented7acc335480900f62da397a1b70ea53553ab6e8 (diff)
downloadandroid_hardware_qcom_bt-7e85a75feb8e9d1c32d81c630bfd86d65a6a1d56.tar.gz
android_hardware_qcom_bt-7e85a75feb8e9d1c32d81c630bfd86d65a6a1d56.tar.bz2
android_hardware_qcom_bt-7e85a75feb8e9d1c32d81c630bfd86d65a6a1d56.zip
Bluetooth: Fix for BT crashes during preload timeout
Check for soc initialization before calling fw cfg call back. If the SoC is not initialized and fw cfg cback is called, stack will be initialized wrongly during preload timeout and might lead to crash. CRs-Fixed: 835078 Change-Id: I409ad81ca90e9d80a07f5c5980a2927cbde80c2b
Diffstat (limited to 'libbt-vendor')
-rw-r--r--libbt-vendor/src/bt_vendor_qcom.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libbt-vendor/src/bt_vendor_qcom.c b/libbt-vendor/src/bt_vendor_qcom.c
index 9bf833c..77ccd55 100644
--- a/libbt-vendor/src/bt_vendor_qcom.c
+++ b/libbt-vendor/src/bt_vendor_qcom.c
@@ -662,8 +662,19 @@ static int op(bt_vendor_opcode_t opcode, void *param)
{
// call hciattach to initalize the stack
if(bt_vendor_cbacks){
- ALOGI("Bluetooth Firmware and transport layer are initialized");
- bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_SUCCESS);
+ if (btSocType == BT_SOC_ROME) {
+ if (is_soc_initialized()) {
+ ALOGI("Bluetooth FW and transport layer are initialized");
+ bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_SUCCESS);
+ } else {
+ ALOGE("bt_vendor_cbacks is null or SoC not initialized");
+ ALOGE("Error : hci, smd initialization Error");
+ retval = -1;
+ }
+ } else {
+ ALOGI("Bluetooth FW and transport layer are initialized");
+ bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_SUCCESS);
+ }
}
else{
ALOGE("bt_vendor_cbacks is null");