This patch adds state check in bta_jv_rfcomm_write, to prevent sending
data in BTA_JV_ST_NONE state. This would prevent ASSERT in code due to
null handle, as handle might have already been set to null during previous
closing of rfcomm connection.
CRs-Fixed:
1041625
Change-Id: Ibc6b1fb7aa6dce9a4acb52d724af3023fad9a9ae
tBTA_JV_PCB *p_pcb = wc->p_pcb;
tBTA_JV_RFCOMM_WRITE evt_data;
+
+ if (p_pcb->state == BTA_JV_ST_NONE) {
+ APPL_TRACE_ERROR("bta_jv_rfcomm_write : Incorect state (%d) to write data, returning",
+ p_pcb->state);
+ return;
+ }
+
evt_data.status = BTA_JV_FAILURE;
evt_data.handle = p_cb->handle;
evt_data.req_id = wc->req_id;