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

Commit e61f8fbb authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Protect the btif config state with a lock during cleanup

Bug: 64186300
Test: Code compilation, enable/disable Bluetooth
Change-Id: Ic2397a128d59c9cc69cbd8252734b69eb7c02501
(cherry picked from commit a4febd6d0460ee0f5834822ca406a4b8bab28cf1)
parent 6f7ec2c4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -231,8 +231,10 @@ static future_t* clean_up(void) {
  btif_config_flush();

  alarm_free(config_timer);
  config_free(config);
  config_timer = NULL;

  std::unique_lock<std::mutex> lock(config_lock);
  config_free(config);
  config = NULL;
  return future_new_immediate(FUTURE_SUCCESS);
}