Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 481d034f authored by Srinu Jella's avatar Srinu Jella Committed by Ajay Panicker
Browse files

Allocate sufficient memory for FCS

Use Case: Hit LeakCanary detection during HDP

Failure: Crash while running LeakCanary detection.

Root cause: Did not have sufficient memory for data frame
which lead to crash.

Fix: Allocating sufficient memory for the data frame
which includes FCS in the header field.

Change-Id: I3bb862f29ecc854423796dc89820ba21c5db6050
parent 3872665d
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -268,7 +268,8 @@ void bta_hl_clean_mdl_cb(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx)
*******************************************************************************/
*******************************************************************************/
BT_HDR * bta_hl_get_buf(UINT16 data_size, BOOLEAN fcs_use)
BT_HDR * bta_hl_get_buf(UINT16 data_size, BOOLEAN fcs_use)
{
{
    size_t size = data_size + L2CAP_MIN_OFFSET + BT_HDR_SIZE;
    size_t size = data_size + L2CAP_MIN_OFFSET + BT_HDR_SIZE + L2CAP_FCS_LEN
                                                   + L2CAP_EXT_CONTROL_OVERHEAD;


    if (fcs_use)
    if (fcs_use)
        size += L2CAP_FCS_LEN;
        size += L2CAP_FCS_LEN;