Merge "[Stability][hwui] check mmap return value"

am: b352dcd153

Change-Id: I8d04c5433ca881e62a23e0aa13e022cdf8d16d9a
This commit is contained in:
zhangkuili
2018-06-21 14:53:15 -07:00
committed by android-build-merger

View File

@@ -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