OSDN Git Service

RFCOMM: Return NULL when out of listen ports
authorMyles Watson <mylesgw@google.com>
Thu, 19 Oct 2017 22:30:29 +0000 (15:30 -0700)
committerMyles Watson <mylesgw@google.com>
Mon, 23 Oct 2017 15:36:25 +0000 (15:36 +0000)
Bug: 67846163
Test: Connect RFCOMM ports until they fail
Change-Id: Ia6cdb5340f8565db0ca5538f8d8ae9c2f25e892e

bta/jv/bta_jv_act.cc

index f34021f..ba49fa6 100644 (file)
@@ -1804,9 +1804,11 @@ static tBTA_JV_PCB* bta_jv_add_rfc_port(tBTA_JV_RFC_CB* p_cb,
             "bta_jv_add_rfc_port: p_pcb->handle:0x%x, curr_sess:%d",
             p_pcb->handle, p_cb->curr_sess);
       }
-    } else
+    } else {
       APPL_TRACE_ERROR(
           "bta_jv_add_rfc_port, cannot create new rfc listen port");
+      return NULL;
+    }
   }
   APPL_TRACE_DEBUG("bta_jv_add_rfc_port: sec id in use:%d, rfc_cb in use:%d",
                    get_sec_id_used(), get_rfc_cb_used());