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

Commit ffbfa5c1 authored by Steven Moreland's avatar Steven Moreland
Browse files

RPC Binder: stronger type checks for AsyncTodo

I was confused why we had a comment saying to only use
local binders when we can use the type to do this. Not
sure what I was thinking, and this confused me when
working on more recent memory issues.

Bug: 416772676
Test: binderRpcTest
Change-Id: I63b15567d904ccfa28a907e8b927d4ce9a8e98e7
parent c950e89f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -953,7 +953,8 @@ processTransactInternalTailCall:
                // we need to process some other asynchronous transaction
                // first
                it->second.asyncTodo.push(BinderNode::AsyncTodo{
                        .ref = target,
                        // checked above
                        .ref = sp<BBinder>::fromExisting(target->localBinder()),
                        .data = std::move(transactionData),
                        .ancillaryFds = std::move(ancillaryFds),
                        .asyncNumber = transaction->asyncNumber,
+2 −2
Original line number Diff line number Diff line
@@ -251,9 +251,9 @@ private:
        // CASE A - local binder we are serving
        //

        // async transaction queue, _only_ for local binder
        struct AsyncTodo {
            sp<IBinder> ref;
            // any transaction, including async, can only be on local binders
            sp<BBinder> ref;
            CommandData data;
            std::vector<std::variant<binder::unique_fd, binder::borrowed_fd>> ancillaryFds;
            uint64_t asyncNumber = 0;