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

Skip to content
Commit 727cbc09 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

EventHub: Close opening device before deleting on sysfs change

We must unregister all fds from epoll before closing them to avoid the
fds from remaining open and thus leaking. Prevent fd leaks by
closing any opening device from epoll before closing the Device
via its destructor when the sysfs node changes and triggers a device
reopening.

In this CL, we modify the closeDeviceLocked function to also look at
mOpeningDevices when a device is being closed.

Context: https://idea.popcount.org/2017-03-20-epoll-is-fundamentally-broken-22/

Bug: 397208968
Test: Presubmit
Flag: EXEMPT bug fix
Change-Id: I3de8a9413e68a0b7409e5d0bf56b9d76b7164b49
parent bcbec20c
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