int ret;
g_fps_monitor.resource_count = get_resource_device_count(RESOURCE_TYPE_DISPLAY);
+ if (g_fps_monitor.resource_count < 0)
+ return g_fps_monitor.resource_count;
+
g_fps_monitor.last_fps = calloc(g_fps_monitor.resource_count, sizeof(double));
if (!g_fps_monitor.last_fps)
return -ENOMEM;
res->mon_id, res->res_id,
res->attrs[idx].id, &array, &length);
- if (ret < 0) break;
+ if (ret < 0 || length < 0) break;
memset(buf, 0, BUFF_MAX + 1);
for (i = 0; i < length; i++) {
/* 1. Initialize resource-monitor */
id = pass_resource_monitor_init();
+ if (id < 0)
+ return id;
+
g_data.mon_id = id;
/* 2. Get resource count */
continue;
}
+ if (count < 0)
+ continue;
+
if (g_resource_type[i].ctrl_val < 0)
continue;