return NULL;
}
+
+ /* check the essential capabilities of tbm_module */
+ gBufMgr->capabilities = tbm_module_bufmgr_get_capabilities(gBufMgr->module);
+ if (gBufMgr->capabilities == HAL_TBM_BUFMGR_CAPABILITY_NONE) {
+ TBM_ERR("The capabilities of the backend module is TBM_BUFMGR_CAPABILITY_NONE.");
+ TBM_ERR("TBM_BUFMGR_CAPABILITY_SHARE_FD is the essential capability.");
+ tbm_module_unload(gBufMgr->module);
+ _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
+ free(gBufMgr);
+ gBufMgr = NULL;
+ pthread_mutex_unlock(&gLock);
+ return NULL;
+ }
+
+ if (!(gBufMgr->capabilities & HAL_TBM_BUFMGR_CAPABILITY_SHARE_FD)) {
+ TBM_ERR("The capabilities of the backend module had no TBM_BUFMGR_CAPABILITY_SHARE_FD.");
+ TBM_ERR("The tbm backend has to get TBM_BUFMGR_CAPABILITY_SHARE_FD. ");
+ tbm_module_unload(gBufMgr->module);
+ _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
+ free(gBufMgr);
+ gBufMgr = NULL;
+ pthread_mutex_unlock(&gLock);
+ return NULL;
+ }
+
/* LCOV_EXCL_STOP */
gBufMgr->ref_count = 1;