hwc: Close release fence fd on buf sync ioctl failure
This change closes the release fence fd in the event that a failure occurs during the buf sync ioctl. This is additional sanity to ensure that we are not leaking any fd's in userspace. Change-Id: Ic303aa2a2ed20244605b0f0bd91145e8f3fc8f1b
This commit is contained in:
@@ -1309,6 +1309,7 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
|||||||
if(ret < 0) {
|
if(ret < 0) {
|
||||||
ALOGE("%s: ioctl MSMFB_BUFFER_SYNC failed for rot sync, err=%s",
|
ALOGE("%s: ioctl MSMFB_BUFFER_SYNC failed for rot sync, err=%s",
|
||||||
__FUNCTION__, strerror(errno));
|
__FUNCTION__, strerror(errno));
|
||||||
|
close(rotReleaseFd);
|
||||||
} else {
|
} else {
|
||||||
close(currLayer->acquireFenceFd);
|
close(currLayer->acquireFenceFd);
|
||||||
//For MDP to wait on.
|
//For MDP to wait on.
|
||||||
@@ -1380,6 +1381,10 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
|||||||
ALOGE("%s: acq_fen_fd_cnt=%d flags=%d fd=%d dpy=%d numHwLayers=%zu",
|
ALOGE("%s: acq_fen_fd_cnt=%d flags=%d fd=%d dpy=%d numHwLayers=%zu",
|
||||||
__FUNCTION__, data.acq_fen_fd_cnt, data.flags, fbFd,
|
__FUNCTION__, data.acq_fen_fd_cnt, data.flags, fbFd,
|
||||||
dpy, list->numHwLayers);
|
dpy, list->numHwLayers);
|
||||||
|
close(releaseFd);
|
||||||
|
releaseFd = -1;
|
||||||
|
close(retireFd);
|
||||||
|
retireFd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user