Skip to content

Commit 7153373

Browse files
Mike McTernanGerrit Code Review
authored andcommitted
Merge "Mark the return of munmap() as unused." into main
2 parents b2653d0 + 733610f commit 7153373

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

libs/binder/Parcel.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,9 @@ status_t Parcel::writeBlob(size_t len, bool mutableCopy, WritableBlob* outBlob)
17251725
}
17261726
}
17271727
}
1728-
::munmap(ptr, len);
1728+
if (::munmap(ptr, len) == -1) {
1729+
ALOGW("munmap() failed: %s", strerror(errno));
1730+
}
17291731
}
17301732
::close(fd);
17311733
return status;
@@ -3331,7 +3333,9 @@ Parcel::Blob::~Blob() {
33313333

33323334
void Parcel::Blob::release() {
33333335
if (mFd != -1 && mData) {
3334-
::munmap(mData, mSize);
3336+
if (::munmap(mData, mSize) == -1) {
3337+
ALOGW("munmap() failed: %s", strerror(errno));
3338+
}
33353339
}
33363340
clear();
33373341
}

0 commit comments

Comments
 (0)