tbm_module: add tbm_module_bo_map and use it
[platform/core/uifw/libtbm.git] / src / tbm_surface_internal.c
index 5b899b9..5089c60 100644 (file)
@@ -949,17 +949,14 @@ _tbm_surface_internal_hal_tbm_import_surface(tbm_bufmgr bufmgr, int width, int h
        return surf;
 
 get_bo_fail:
+       for (j = 0; j < i; j++) {
+               if (surf->bos[j])
+                       tbm_bo_unref(surf->bos[j]);
+       }
 get_memory_types_fail:
 get_bos_fail:
 query_plane_data_fail:
-       if (hal_surface) {
-               hal_tbm_surface_free(hal_surface);
-       } else {
-               for (j = 0; j < i; j++) {
-                       if (surf->bos[j])
-                               tbm_bo_unref(surf->bos[j]);
-               }
-       }
+       hal_tbm_surface_free(hal_surface);
 import_surface_fail:
 num_planes_fail:
 bpp_fail:
@@ -2969,9 +2966,6 @@ tbm_surface_internal_export(tbm_surface_h surface, tbm_error_e *error)
 
        TBM_TRACE_SURFACE_INTERNAL("tbm_surface(%p) buffer_data(%p)", surface, buffer_data);
 
-       if (error)
-               *error = TBM_ERROR_NONE;
-
        _tbm_set_last_result(TBM_ERROR_NONE);
        _tbm_surface_mutex_unlock();