summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pomai Ahlo <poahlo@google.com> 2024-04-19 16:41:42 -0700
committer Pomai Ahlo <poahlo@google.com> 2024-04-19 16:41:42 -0700
commitee7d775a54ec4320afed6fb5665bb26980fb7d6a (patch)
tree76a41f681bce818d8bedf723dd88fa316bfe7402
parent742935012aa2cbccd533025a8ce336f93d727bb6 (diff)
Log when p_cb or p_cb->p_cback is NULL
If p_cb or p_cb->p_cback is NULL, bta_jv_port_mgmt_cl_cback returns early. Log when this happens. Bug: 292143051 Test: m Bluetooth Flag: EXEMPT logging change only Change-Id: I739d0fa1026f43de3a87520a36caf9bb8fb53b09
-rw-r--r--system/bta/jv/bta_jv_act.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/system/bta/jv/bta_jv_act.cc b/system/bta/jv/bta_jv_act.cc
index 1f5beb5653..623881317e 100644
--- a/system/bta/jv/bta_jv_act.cc
+++ b/system/bta/jv/bta_jv_act.cc
@@ -1360,8 +1360,14 @@ static void bta_jv_port_mgmt_cl_cback(uint32_t code, uint16_t port_handle) {
uint16_t lcid;
tBTA_JV_RFCOMM_CBACK* p_cback; /* the callback function */
- log::verbose("code={}, port_handle={}", code, port_handle);
- if (NULL == p_cb || NULL == p_cb->p_cback) return;
+ if (p_cb == NULL) {
+ log::warn("p_cb is NULL, code={}, port_handle={}", code, port_handle);
+ return;
+ } else if (p_cb->p_cback == NULL) {
+ log::warn("p_cb->p_cback is null, code={}, port_handle={}", code,
+ port_handle);
+ return;
+ }
log::verbose("code={}, port_handle={}, handle={}", code, port_handle,
p_cb->handle);