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

Commit e117229c authored by Manu Viswanadhan's avatar Manu Viswanadhan Committed by Pavlin Radoslavov
Browse files

Fix FD leak caused by module wrapper thread

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 cleanup the module wrapper thread is
stopped but the resources are not freed, leading to FD leak.

Fix: Cleanup the module wrapper thread properly so that there
are no resource leaks.

Bug: 28312228
Change-Id: I4de2fba9c98a0e4ae73315759ec6bc8bf273948e
parent 84be9f62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ static void post_result_to_callback(void *context) {
  thread_fn callback = wrapper->callback;

  // Clean up the resources we used
  thread_stop(wrapper->lifecycle_thread);
  thread_free(wrapper->lifecycle_thread);
  osi_free(wrapper);

  callback(result);