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

Commit 394a4f6a authored by Manu Viswanadhan's avatar Manu Viswanadhan Committed by Myles Watson
Browse files

btif: Remove unused synchronization in event_cleanup_stack

Use Case: Repeated BT ON/OFF

Failure: FD leak is observed with ON/OFF stress test
which eventually leads to crash due to unavailability
of FDs.

Steps:
BT ON/OFF

Root Cause: During stack cleanup an unused future
structure is created which is not freed, leading to FD
leak.

Fix: Remove the creation of the future structure

Test: BT ON/OFF
Fixes: 36019324
Change-Id: Id5945da87f00eb7ab77a5f217c95cc43f0136e06
parent 95c39997
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -194,8 +194,6 @@ static void ensure_stack_is_not_running(void) {

// Synchronous function to clean up the stack
static void event_clean_up_stack(void* context) {
  future_t* local_hack_future;

  if (!stack_is_initialized) {
    LOG_INFO(LOG_TAG, "%s found the stack already in a clean state", __func__);
    goto cleanup;
@@ -204,8 +202,6 @@ static void event_clean_up_stack(void* context) {
  ensure_stack_is_not_running();

  LOG_INFO(LOG_TAG, "%s is cleaning up the stack", __func__);
  local_hack_future = future_new();
  hack_future = local_hack_future;
  stack_is_initialized = false;

  btif_cleanup_bluetooth();