From: SooChan Lim Date: Wed, 23 Jun 2021 05:36:37 +0000 (+0900) Subject: tbm_bufmgr: remove the duplicated code X-Git-Tag: submit/tizen/20210624.054931~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=443c7c9da145d248d6df8d65e1bf69e0da649d21;p=platform%2Fcore%2Fuifw%2Flibtbm.git tbm_bufmgr: remove the duplicated code Change-Id: I6feb7f196d7a3ab93a32f8de6e9797de5bf5ccc5 --- diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index aecf23d..6457f16 100644 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -933,8 +933,7 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); *error = TBM_ERROR_OUT_OF_MEMORY; - _tbm_bufmgr_mutex_unlock(); - return NULL; + goto failed; /* LCOV_EXCL_STOP */ } @@ -942,8 +941,7 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i if (!bo->bo_data) { /* LCOV_EXCL_START */ free(bo); - _tbm_bufmgr_mutex_unlock(); - return NULL; + goto failed; /* LCOV_EXCL_STOP */ } @@ -952,8 +950,9 @@ 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: +failed: _tbm_bufmgr_mutex_unlock(); return NULL;