From 9612bdcdaa6789d0c331fc54b38f9259681bb776 Mon Sep 17 00:00:00 2001 From: YoungJun Cho Date: Wed, 2 Nov 2016 22:47:49 +0900 Subject: [PATCH] tbm_surface_internal: clean up tbm_surface_internal_get_info() This patch cleans up tbm_surface_internal_get_info(). There is a missed error routine. Change-Id: I31be6bcb1b974c7ca7e6016b4a0879a766ab3089 Signed-off-by: YoungJun Cho --- src/tbm_surface_internal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index d915d59..cf7fb73 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -1036,8 +1036,14 @@ tbm_surface_internal_get_info(tbm_surface_h surface, int opt, } } } else { - for (i = 0; i < surf->num_bos; i++) + for (i = 0; i < surf->num_bos; i++) { bo_handles[i] = tbm_bo_get_handle(surf->bos[i], TBM_DEVICE_CPU); + if (bo_handles[i].ptr == NULL) { + TBM_TRACE("error: tbm_surface(%p) opt(%d) map(%d)\n", surface, opt, map); + _tbm_surface_mutex_unlock(); + return 0; + } + } } for (i = 0; i < surf->info.num_planes; i++) { -- 2.7.4