Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9147c2d authored by Daniel Jarai's avatar Daniel Jarai Committed by Dániel Járai
Browse files

Avoid closing invalid fds in GraphicBufferMapper

unlockAsync will not necessarily return a valid FD.

Change-Id: I86b06ec451017c6b665c545e2455883fdb8a3e47
parent 9a8ea13a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ status_t GraphicBufferMapper::unlock(buffer_handle_t handle)
{
    int32_t fenceFd = -1;
    status_t error = unlockAsync(handle, &fenceFd);
    if (error == NO_ERROR) {
    if (error == NO_ERROR && fenceFd >= 0) {
        sync_wait(fenceFd, -1);
        close(fenceFd);
    }