diff --git a/system/btif/src/btif_rc.cc b/system/btif/src/btif_rc.cc index 0ac4e0428338bc6b2daaad9509c613fd2e541bcf..295aef69e802d2c7fe47f8971467143b221bf5d3 100644 --- a/system/btif/src/btif_rc.cc +++ b/system/btif/src/btif_rc.cc @@ -732,20 +732,19 @@ void handle_rc_disconnect(tBTA_AV_RC_CLOSE* p_rc_close) { * ***************************************************************************/ void handle_rc_passthrough_cmd(tBTA_AV_REMOTE_CMD* p_remote_cmd) { + if (p_remote_cmd == NULL) { + BTIF_TRACE_ERROR("%s: No remote command!", __func__); + return; + } + btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_handle(p_remote_cmd->rc_handle); - if (p_dev == NULL) { BTIF_TRACE_ERROR("%s: Got passthrough command from invalid rc handle", __func__); return; } - if (p_remote_cmd == NULL) { - BTIF_TRACE_ERROR("%s: No remote command!", __func__); - return; - } - bt_bdaddr_t rc_addr; bdcpy(rc_addr.address, p_dev->rc_addr);