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

Commit 77269eea authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the error and make the argument nonnull"

parents d2129964 8ee5768b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -362,10 +362,12 @@ int MtpFfsHandle::waitEvents(struct io_buffer *buf, int min_events, struct io_ev

void MtpFfsHandle::cancelTransaction() {
    // Device cancels by stalling both bulk endpoints.
    if (::read(mBulkIn, nullptr, 0) != -1 || errno != EBADMSG)
    void *buf = malloc(sizeof(char));
    if (::read(mBulkIn, buf, 0) != -1 || errno != EBADMSG)
        PLOG(ERROR) << "Mtp stall failed on bulk in";
    if (::write(mBulkOut, nullptr, 0) != -1 || errno != EBADMSG)
    if (::write(mBulkOut, buf, 0) != -1 || errno != EBADMSG)
        PLOG(ERROR) << "Mtp stall failed on bulk out";
    free(buf);
    mCanceled = true;
    errno = ECANCELED;
}