From: Changyeon Lee Date: Fri, 16 Apr 2021 09:04:25 +0000 (+0900) Subject: fix leak of acquire fence fd X-Git-Tag: accepted/tizen/unified/20210416.143416~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7a6f790d710ab8cd0ee1807ba3aa23a96f86708;p=platform%2Fadaptation%2Fbroadcom%2Flibtdm-vc4.git fix leak of acquire fence fd Change-Id: Iac6c9f8d770e5f32ae22764e7867c6cbfd895845 --- 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);