Fix app manager/framework issues reported by Coverity (#1155)

runtime_sensor.c: add return value check for os_mutex_init
                             fix find_sensor_client
sensor_mgr_ref.c: add return value check for init_sensor_framework
app_manager_host.c: add return value check for app_manager_host_init
module_wasm_app.c: add bh_assert for m_data
                                   fix mkdir potential issue
sample littlevgl/gui/simple: add return value check for init_sensor_framework
host_tool: add more check for g_conn_fd
This commit is contained in:
Xu Jun
2022-05-07 15:43:34 +08:00
committed by GitHub
parent 3edb832f76
commit a7f4c3c15c
11 changed files with 66 additions and 30 deletions

View File

@ -264,15 +264,21 @@ aee_host_msg_callback(void *msg, uint32_t msg_len)
bool
app_manager_host_init(host_interface *interface)
{
os_mutex_init(&host_lock);
if (os_mutex_init(&host_lock) != 0) {
return false;
}
memset(&recv_ctx, 0, sizeof(recv_ctx));
host_commu.init = interface->init;
host_commu.send = interface->send;
host_commu.destroy = interface->destroy;
if (host_commu.init != NULL)
return host_commu.init();
if (host_commu.init != NULL) {
if (!host_commu.init()) {
os_mutex_destroy(&host_lock);
return false;
}
}
return true;
}