fix warning: struct argument contains uninitialized data
This fixes the warning warning: Passed-by-value struct argument contains
uninitialized data (e.g., field: 'command') [clang-analyzer-core.CallAndMessage]
Bug: None
Test: The warning is gone.
Change-Id: I3e06ff484bdec995c5125433acb5c3f14dc29dd9
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 753d833..5a1d6dc 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -1060,6 +1060,9 @@
mfr.length = mSendObjectFileSize - initialData;
}
+ mfr.command = 0;
+ mfr.transaction_id = 0;
+
// transfer the file
ret = sHandle->receiveFile(mfr);
if ((ret < 0) && (errno == ECANCELED)) {
@@ -1257,6 +1260,8 @@
mfr.fd = edit->mFD;
mfr.offset = offset;
mfr.length = length;
+ mfr.command = 0;
+ mfr.transaction_id = 0;
// transfer the file
ret = sHandle->receiveFile(mfr);