fix the crash 93/173693/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 23 Mar 2018 06:47:04 +0000 (15:47 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 23 Mar 2018 06:47:04 +0000 (15:47 +0900)
Change-Id: I62510f67938cf84d81b1f87fd55ca1d91ed2ded8

src/tbm_bufmgr.c

index d99b467..1e6b471 100644 (file)
@@ -806,7 +806,7 @@ tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr)
                                TBM_SNRPRINTF(str, len, c, " bo:%-12p  %-26d%-10d\n",
                                          surf->bos[i],
                                          surf->bos[i]->ref_cnt,
-                                         bufmgr->backend->bo_size(surf->bos[i]) / 1024);
+                                         size / 1024);
                        }
                }
        } else
@@ -820,14 +820,20 @@ tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr)
        if (!LIST_IS_EMPTY(&bufmgr->bo_list)) {
                int bo_cnt = 0;
                tbm_bo bo = NULL;
+               tbm_key key = 0;
 
                LIST_FOR_EACH_ENTRY(bo, &bufmgr->bo_list, item_link) {
                        if (bufmgr->backend_module_data) {
                                size = bufmgr->bo_func->bo_get_size(bo->bo_data, &error);
                                if (error != TBM_ERROR_NONE)
                                        TBM_WRN("fail to get the size of bo.");
-                       } else
+                               key = bufmgr->bo_func->bo_export_key(bo->bo_data, &error);
+                               if (error != TBM_ERROR_NONE)
+                                       TBM_WRN("fail to get the tdm_key of bo.");
+                       } else {
                                size = bufmgr->backend->bo_size(bo);
+                               key = bufmgr->backend->bo_export(bo);
+                       }
                        TBM_SNRPRINTF(str, len, c, "%-4d%-11p   %-4d  %-6d     %-5d     %-4u    %-3d  %-11p  %-4d\n",
                                  ++bo_cnt,
                                  bo,
@@ -837,7 +843,7 @@ tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr)
                                  bo->map_cnt,
                                  bo->flags,
                                  bo->surface,
-                                 bufmgr->backend->bo_export(bo));
+                                 key);
                }
        } else
                TBM_SNRPRINTF(str, len, c, "no tbm_bos.\n");