tbm_backend_bo_func *bo_func = NULL;
int fp;
tbm_error_e err;
+ int set_master = 0;
if (!bufmgr) {
TBM_ERR("bufmgr is null.\n");
if (drmIsMaster(bufmgr_sprd->fd)) {
tbm_drm_helper_set_tbm_master_fd(bufmgr_sprd->fd);
+ set_master = 1;
bufmgr_sprd->device_name = drmGetDeviceNameFromFd(bufmgr_sprd->fd);
if (!bufmgr_sprd->device_name) {
if (bufmgr_sprd->hashBos)
drmHashDestroy(bufmgr_sprd->hashBos);
fail_init_cache_state:
- if (tbm_drm_helper_get_master_fd() >= 0)
+ if (set_master)
tbm_drm_helper_unset_tbm_master_fd();
tbm_drm_helper_unset_fd();
if (bufmgr_sprd->device_name)