tbm_bo_unmap set ERROR NONE to last result in case of tbm_bo_map is failed
Change-Id: I160d38ebd07020b7b1a5766eacaab7d40c8bb69e
tbm_bo bos[4];
int planes_bo_idx[TBM_SURF_PLANE_MAX];
int i, j;
+ tbm_error_e error;
_tbm_surface_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
for (i = 0; i < num_bos; i++) {
bo_handles[i] = tbm_bo_map(bos[i], TBM_DEVICE_CPU, opt);
if (bo_handles[i].ptr == NULL) {
+ error = tbm_get_last_error();
for (j = 0; j < i; j++)
tbm_bo_unmap(bos[j]);
+ _tbm_set_last_result(error);
TBM_ERR("error: tbm_surface(%p) opt(%d) map(%d)\n", surface, opt, map);
return 0;
}