From c013e696af49a1459546bf9ebe7273e2352b4e82 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 23 Jun 2021 13:52:54 +0900 Subject: [PATCH] tbm_bo: initialize the bo->user_data_list at bo_free instead of LIST_INITHEAD at tbm_bo_import_fd Change-Id: I97550425189bcf596614baf7dabca66866478af3 --- src/tbm_bo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tbm_bo.c b/src/tbm_bo.c index 658f852..2f47978 100644 --- a/src/tbm_bo.c +++ b/src/tbm_bo.c @@ -561,8 +561,6 @@ tbm_bo_import_fd(tbm_bufmgr bufmgr, tbm_fd fd) /* LCOV_EXCL_STOP */ } - LIST_INITHEAD(&bo->user_data_list); // TODO: remove this. build-break when it is removed. - TBM_TRACE_BO("import bo(%p) ref(%d) fd(%d) flag(%s)\n", bo, bo->ref_cnt, fd, _tbm_flag_to_str(bo->flags)); @@ -845,11 +843,12 @@ _tbm_bo_free(tbm_bo bo) if (!LIST_IS_EMPTY(&bo->user_data_list)) { tbm_user_data *old_data = NULL, *tmp; - LIST_FOR_EACH_ENTRY_SAFE(old_data, tmp, - &bo->user_data_list, item_link) { + LIST_FOR_EACH_ENTRY_SAFE(old_data, tmp, &bo->user_data_list, item_link) { TBM_DBG("free user_data\n"); user_data_delete(old_data); } + + LIST_INITHEAD(&bo->user_data_list); // TODO: remove this. build-break when it is removed. } while (bo->lock_cnt > 0) { -- 2.7.4