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

Commit 18e86afd authored by Kamal Negi's avatar Kamal Negi Committed by Andre Eisenbach
Browse files

Set alarm's queue to NULL on alarm expired

Use Case: Repeated BT ON/OFF

Failure: ANR due to race condition between random advertisement
address generation completion(adv_raddr_timer) and BT shutdown.

Steps: SNS Stress testing.

Root Cause: Race condition happens between random advertisement
address generation completion(adv_raddr_timer) and BT shutdown.

Fix:  For non-periodic alarms, set alarm's queue to NULL once alarm
expired.

Test: mm -j8

Change-Id: Idf8e2bebdc2ca7621aef06dd5f2075ef2c5fa08c
parent 72728794
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -563,6 +563,7 @@ static void alarm_queue_ready(fixed_queue_t* queue, UNUSED_ATTR void* context) {
    alarm->deadline = 0;
    alarm->callback = NULL;
    alarm->data = NULL;
    alarm->queue = NULL;
  }

  std::lock_guard<std::recursive_mutex> cb_lock(*alarm->callback_mutex);