From: Junkyeong Kim Date: Thu, 11 Mar 2021 08:42:42 +0000 (+0900) Subject: Tdm_bo: Add null checking before use X-Git-Tag: submit/tizen/20210316.103642~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Flibtbm.git;a=commitdiff_plain;h=c2e3112302296d50e837880035a8445b75a9b4c5 Tdm_bo: Add null checking before use Change-Id: I1b780b2eaeaac3cbf316156475a217f0628bef26 Signed-off-by: Junkyeong Kim --- diff --git a/src/tbm_bo.c b/src/tbm_bo.c index eb188f1..b5d5b53 100644 --- a/src/tbm_bo.c +++ b/src/tbm_bo.c @@ -464,8 +464,9 @@ tbm_bo_alloc_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, if (ret != HAL_TBM_ERROR_NONE) { if (ret != HAL_TBM_ERROR_NOT_SUPPORTED) { TBM_ERR("error: fail to tbm_bo_alloc_with_format\n"); + if (error) + _tbm_set_last_result(*error); } - _tbm_set_last_result(*error); goto bo_alloc_fail; } } else { @@ -474,7 +475,8 @@ tbm_bo_alloc_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, if (!bo_data) { TBM_ERR("error: fail to tbm_bo_alloc_with_format fmt(%s) idx(%d) w(%d) h(%d) mem_types(%s)\n", FOURCC_STR(format), bo_idx, width, height, _tbm_flag_to_str(flags)); - _tbm_set_last_result(*error); + if (error) + _tbm_set_last_result(*error); goto bo_alloc_fail; } } @@ -534,8 +536,9 @@ tbm_bo_alloc_with_tiled_format(tbm_bufmgr bufmgr, int width, int height, int bpp if (ret != HAL_TBM_ERROR_NOT_SUPPORTED) { TBM_ERR("error: fail to tbm_bo_alloc_with_tiled_format fmt(%s) idx(%d) w(%d) h(%d) flags(%s)\n", FOURCC_STR(format), bo_idx, width, height, _tbm_flag_to_str(flags)); + if (error) + _tbm_set_last_result(*error); } - _tbm_set_last_result(*error); goto bo_alloc_fail; } } else { @@ -544,7 +547,8 @@ tbm_bo_alloc_with_tiled_format(tbm_bufmgr bufmgr, int width, int height, int bpp if (!bo_data) { TBM_ERR("error: fail to tbm_bo_alloc_with_tiled_format fmt(%s) idx(%d) w(%d) h(%d) flags(%s)\n", FOURCC_STR(format), bo_idx, width, height, _tbm_flag_to_str(flags)); - _tbm_set_last_result(*error); + if (error) + _tbm_set_last_result(*error); goto bo_alloc_fail; } }