tbm_bo: fix wrong last error when tbm_bo_map is failed 85/265285/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 14 Oct 2021 05:29:10 +0000 (14:29 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 14 Oct 2021 05:29:10 +0000 (14:29 +0900)
Change-Id: I85b46f18be8b1850c83c10c0c298ea5cc7c3e780

src/tbm_bo.c

index 1987327..02f4619 100644 (file)
@@ -376,8 +376,8 @@ tbm_bo_map(tbm_bo bo, int device, int opt)
        if (bo_handle.ptr == NULL) {
                /* LCOV_EXCL_START */
                TBM_ERR("error: fail to map bo:%p error:%d\n", bo, error);
-               _tbm_set_last_result(error);
                _tbm_bo_unlock(bo);
+               _tbm_set_last_result(error);
                _tbm_bufmgr_mutex_unlock();
                return (tbm_bo_handle) NULL;
                /* LCOV_EXCL_STOP */