Fix clang static analyzer warnings.
Fix the following warning:
frameworks/av/media/mtp/MtpServer.cpp:1098:5: warning: Assigned value is
garbage or undefined [clang-analyzer-core.uninitialized.Assign]
BUG:None
TEST:Warnings fixed.
Change-Id: If4e54ebd9b865e2e6cdc7666da0c9987a918df7c
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 88dabff..b4947f8 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -1015,6 +1015,7 @@
mode_t mask;
int ret, initialData;
bool isCanceled = false;
+ struct stat sstat = {};
auto start = std::chrono::steady_clock::now();
@@ -1071,7 +1072,6 @@
}
}
}
- struct stat sstat;
fstat(mfr.fd, &sstat);
close(mfr.fd);