summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author zhangkuili <zhangkuili@xiaomi.com> 2018-06-21 15:04:48 -0700
committer android-build-merger <android-build-merger@google.com> 2018-06-21 15:04:48 -0700
commit4fe18f31d5c7a7984d0bd728eed5d9d3787b52cb (patch)
tree9100a5dab4a254dced346c33688d7a7ec2a8587b
parent2272f08724f287b640f468cfb2357148fca7a5e8 (diff)
parent399ac24bdfe0c06e04ff239bb77c57c6170ee074 (diff)
Merge "[Stability][hwui] check mmap return value" am: b352dcd153
am: 399ac24bdf Change-Id: I4075c1d652eb645e2f7ab05ecdb66fda4636423e
-rw-r--r--libs/hwui/service/GraphicsStatsService.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/service/GraphicsStatsService.cpp b/libs/hwui/service/GraphicsStatsService.cpp
index 7f8cb2d1f577..3d50d2d7e59c 100644
--- a/libs/hwui/service/GraphicsStatsService.cpp
+++ b/libs/hwui/service/GraphicsStatsService.cpp
@@ -127,7 +127,7 @@ bool GraphicsStatsService::parseFromFile(const std::string& path,
return false;
}
void* addr = mmap(nullptr, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
- if (!addr) {
+ if (addr == MAP_FAILED) {
int err = errno;
// The file not existing is normal for addToDump(), so only log if
// we get an unexpected error