From b7a6f790d710ab8cd0ee1807ba3aa23a96f86708 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 16 Apr 2021 18:04:25 +0900 Subject: fix leak of acquire fence fd Change-Id: Iac6c9f8d770e5f32ae22764e7867c6cbfd895845 --- src/libhal-backend-tdm-vc4/tdm_vc4_hwc_window.c | 3 +++ src/libtdm-vc4/tdm_vc4_hwc_window.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/libhal-backend-tdm-vc4/tdm_vc4_hwc_window.c b/src/libhal-backend-tdm-vc4/tdm_vc4_hwc_window.c index c67312e..84100d6 100644 --- a/src/libhal-backend-tdm-vc4/tdm_vc4_hwc_window.c +++ b/src/libhal-backend-tdm-vc4/tdm_vc4_hwc_window.c @@ -41,6 +41,9 @@ vc4_hwc_window_destroy(hal_tdm_hwc_window *hwc_window) TDM_BACKEND_RETURN_IF_FAIL(hwc_window_data != NULL); + if (hwc_window_data->acquire_fence >= 0) + close(hwc_window_data->acquire_fence); + LIST_DEL(&hwc_window_data->link); free(hwc_window_data); diff --git a/src/libtdm-vc4/tdm_vc4_hwc_window.c b/src/libtdm-vc4/tdm_vc4_hwc_window.c index ae16635..6cfc80c 100644 --- a/src/libtdm-vc4/tdm_vc4_hwc_window.c +++ b/src/libtdm-vc4/tdm_vc4_hwc_window.c @@ -41,6 +41,9 @@ vc4_hwc_window_destroy(tdm_hwc_window *hwc_window) RETURN_IF_FAIL(hwc_window_data != NULL); + if (hwc_window_data->acquire_fence >= 0) + close(hwc_window_data->acquire_fence); + LIST_DEL(&hwc_window_data->link); free(hwc_window_data); -- cgit v1.2.3