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

Commit 9b130071 authored by Pawan Wagh's avatar Pawan Wagh
Browse files

Fixing null deference in android.hardware.usb.gadget-service.example

Test: atest VtsAidlUsbTargetTest
Bug: 267534245
Change-Id: Ib28b7848205809912b6789d0e050c1a981dc1ce8
Merged-In: Ib28b7848205809912b6789d0e050c1a981dc1ce8
parent 915fde07
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,9 @@ void currentFunctionsAppliedCallback(bool functionsApplied, void* payload) {

ScopedAStatus UsbGadget::getCurrentUsbFunctions(const shared_ptr<IUsbGadgetCallback>& callback,
                                                int64_t in_transactionId) {
    if (callback == nullptr) {
        return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER);
    }
    ScopedAStatus ret = callback->getCurrentUsbFunctionsCb(
            mCurrentUsbFunctions,
            mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED,