From 76f4d53eafbf6c42b8a929eac336e066a33a1da8 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 23 Jun 2021 14:26:14 +0900 Subject: [PATCH] tbm_bufmgr: donot call _tbm_set_last_result The caller of tbm_bufmgr_internal_alloc_bo_with_format calls _tbm_set_last_result with the error value. Change-Id: If64031796a5a35b5c811ba2da614674ea6510ef3 --- src/tbm_bufmgr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index ac57df7..aecf23d 100644 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -923,7 +923,6 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i tbm_bo bo = NULL; _tbm_bufmgr_mutex_lock(); - _tbm_set_last_result(TBM_ERROR_NONE); TBM_BUFMGR_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr), NULL); @@ -933,17 +932,19 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i if (!bo) { /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); - _tbm_set_last_result(TBM_ERROR_OUT_OF_MEMORY); + *error = TBM_ERROR_OUT_OF_MEMORY; + _tbm_bufmgr_mutex_unlock(); + return NULL; /* LCOV_EXCL_STOP */ - goto fail; } bo->bo_data = tbm_module_alloc_bo_data_with_format(bufmgr->module, format, bo_idx, width, height, bpp, flags, error); if (!bo->bo_data) { /* LCOV_EXCL_START */ - _tbm_set_last_result(*error); + free(bo); + _tbm_bufmgr_mutex_unlock(); + return NULL; /* LCOV_EXCL_STOP */ - goto fail; } _tbm_bufmgr_initialize_bo(bufmgr, bo, flags); @@ -951,13 +952,12 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i _tbm_bufmgr_mutex_unlock(); return bo; - +/* LCOV_EXCL_START */ fail: - if (bo) - free(bo); _tbm_bufmgr_mutex_unlock(); return NULL; +/* LCOV_EXCL_STOP */ } tbm_bo -- 2.7.4