Revert "Fix the error and make the argument nonnull"
This reverts commit 8ee5768bf8d5683f5e1b9711fd9b2447629c0b41.
Reason for revert: this argument will be corrected as null_unspecified
Change-Id: Ia6ab97657737f77125e974c45d0a2d1a6342dadc
diff --git a/media/mtp/MtpFfsHandle.cpp b/media/mtp/MtpFfsHandle.cpp
index b72fcfb..2ffd775 100644
--- a/media/mtp/MtpFfsHandle.cpp
+++ b/media/mtp/MtpFfsHandle.cpp
@@ -362,12 +362,10 @@
void MtpFfsHandle::cancelTransaction() {
// Device cancels by stalling both bulk endpoints.
- void *buf = malloc(sizeof(char));
- if (::read(mBulkIn, buf, 0) != -1 || errno != EBADMSG)
+ if (::read(mBulkIn, nullptr, 0) != -1 || errno != EBADMSG)
PLOG(ERROR) << "Mtp stall failed on bulk in";
- if (::write(mBulkOut, buf, 0) != -1 || errno != EBADMSG)
+ if (::write(mBulkOut, nullptr, 0) != -1 || errno != EBADMSG)
PLOG(ERROR) << "Mtp stall failed on bulk out";
- free(buf);
mCanceled = true;
errno = ECANCELED;
}