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

Commit 275bc4e0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check for null callback pointers in the Vendor HAL AIDL callback util." into main

parents 4756ccce 11104185
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ class AidlCallbackHandler {
    ~AidlCallbackHandler() { invalidate(); }

    bool addCallback(const std::shared_ptr<CallbackType>& cb) {
        if (cb == nullptr) {
            LOG(ERROR) << "Unable to register a null callback";
            return false;
        }

        std::unique_lock<std::mutex> lk(callback_handler_lock_);
        void* cbPtr = reinterpret_cast<void*>(cb->asBinder().get());
        const auto& cbPosition = findCbInSet(cbPtr);