Surface::{cancel,queue}Buffer and GraphicBufferMapper::lockAsyncYCbCr take the
ownership of |fenceFd|s. Though they don't close it on error cases.
Change-Id: I49a7ce8837d5c510c4ac4ad4649f310d18610e80
(cherry picked from commit
c7263fb43297744eb04b11025424c0c526d5584c)
Mutex::Autolock lock(mMutex);
int i = getSlotFromBufferLocked(buffer);
if (i < 0) {
+ if (fenceFd >= 0) {
+ close(fenceFd);
+ }
return i;
}
sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE);
}
int i = getSlotFromBufferLocked(buffer);
if (i < 0) {
+ if (fenceFd >= 0) {
+ close(fenceFd);
+ }
return i;
}
bounds.left, bounds.top, bounds.width(), bounds.height(),
ycbcr);
} else {
+ if (fenceFd >= 0) {
+ close(fenceFd);
+ }
return -EINVAL; // do not log failure
}