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

Skip to content
Commit e33e3828 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Fix a race condition in the HCI module start_up()

* Fix a race condition when using the static startup_future
  inside hci_layer.c
  The future_new() allocation happens inside function start_up()
  and the allocated "startup_future" value is returned, so the caller can
  call future_await(future).
  However, if firmware_config_callback() is called on another thread
  BEFORE the "return startup_future;" statement is reached, then
  "startup_future" is reset to NULL. As a result, the caller
  will call future_await(NULL), and we have memory leak: startup_future
  is never freed.

* Fix other similar potential race conditions inside stack_manager.c
  where the static "hack_future" variable could be reassigned between
  the future_new() and future_await() calls.

Bug: 25766403
Change-Id: I0ef1165efba7412c190dfa2a7660189b28fa78a6
parent e532824b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment