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
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 @@
             {
                 // 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");