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

Commit 5e74c65a authored by Chia-I Wu's avatar Chia-I Wu
Browse files

surfaceflinger: fix a release fence leak

We leak release fence fds when we believe hwcomposer2 gives us any
invalid layer and return early.

Bug: 38151478
Test: boots
Change-Id: I299721eca8bc7927052170fe87ee51e9b91006aa
parent 4052245c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -917,6 +917,9 @@ Error Display::getReleaseFences(
        } else {
            ALOGE("getReleaseFences: invalid layer %" PRIu64
                    " found on display %" PRIu64, layerIds[element], mId);
            for (; element < numElements; ++element) {
                close(fenceFds[element]);
            }
            return Error::BadLayer;
        }
    }