summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author zijunzhao <zijunzhao@google.com> 2023-05-18 19:29:02 +0000
committer Zijun Zhao <zijunzhao@google.com> 2023-05-18 23:12:26 +0000
commite43d0d0159494220aa67bf47eff45788b52987d6 (patch)
treec6c672498ed8f1d18f731fefbdb93c1277a6ad15
parent855810c4e9c2e03d025d47f75ba199586af791d5 (diff)
Fix -Wnullable-to-nonnull-conversion error
Fix the build errors like https://android-build.googleplex.com/builds/pending/P56005836/aosp_arm64-userdebug/latest/view/logs/build.log Bugs: b/245972273 Test: mm -j Change-Id: I8edeace5afddc2cf6783899c889a3f2a542156a3
-rw-r--r--libs/binder/MemoryHeapBase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp
index 8fe1d2bb3d..3da06ba4db 100644
--- a/libs/binder/MemoryHeapBase.cpp
+++ b/libs/binder/MemoryHeapBase.cpp
@@ -78,7 +78,7 @@ MemoryHeapBase::MemoryHeapBase(size_t size, uint32_t flags, char const * name)
if (SEAL_FLAGS && (fcntl(fd, F_ADD_SEALS, SEAL_FLAGS) == -1)) {
ALOGE("MemoryHeapBase: MemFD %s sealing with flags %x failed with error %s", name,
SEAL_FLAGS, strerror(errno));
- munmap(mBase, mSize);
+ if (mNeedUnmap) munmap(mBase, mSize);
mBase = nullptr;
mSize = 0;
close(fd);