From d6f7bcf85f90c3d26c8345a282e9f57c6e933212 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 23 Aug 2020 11:55:19 -0700 Subject: [PATCH] Remove tL2C_CB::tL2C_LCB::p_hcit_rcv_acl Never allocated, but always freed buffer Luckily it's always null Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I0a5a6ea2178b1478b9a992028f5f181ed5344367 --- stack/l2cap/l2c_int.h | 1 - stack/l2cap/l2c_utils.cc | 3 --- 2 files changed, 4 deletions(-) diff --git a/stack/l2cap/l2c_int.h b/stack/l2cap/l2c_int.h index fb7bf85a5..69e42e2e6 100644 --- a/stack/l2cap/l2c_int.h +++ b/stack/l2cap/l2c_int.h @@ -380,7 +380,6 @@ typedef struct t_l2c_linkcb { uint8_t peer_chnl_mask[L2CAP_FIXED_CHNL_ARRAY_SIZE]; - BT_HDR* p_hcit_rcv_acl; /* Current HCIT ACL buf being rcvd */ uint16_t idle_timeout_sv; /* Save current Idle timeout */ uint8_t acl_priority; /* L2C_PRIORITY_NORMAL or L2C_PRIORITY_HIGH */ tL2CA_NOCP_CB* p_nocp_cb; /* Num Cmpl pkts callback */ diff --git a/stack/l2cap/l2c_utils.cc b/stack/l2cap/l2c_utils.cc index befe18ef5..f2f490e08 100644 --- a/stack/l2cap/l2c_utils.cc +++ b/stack/l2cap/l2c_utils.cc @@ -143,9 +143,6 @@ void l2cu_release_lcb(tL2C_LCB* p_lcb) { alarm_free(p_lcb->info_resp_timer); p_lcb->info_resp_timer = NULL; - /* Release any unfinished L2CAP packet on this link */ - osi_free_and_reset((void**)&p_lcb->p_hcit_rcv_acl); - if (p_lcb->transport == BT_TRANSPORT_BR_EDR) /* Release all SCO links */ BTM_RemoveSco(p_lcb->remote_bd_addr); -- 2.11.0