if (!config_id)
return NULL;
- snd_config_search(class, config_id, &obj_cfg);
+ if (snd_config_search(class, config_id, &obj_cfg) < 0)
+ return NULL;
free(config_id);
return obj_cfg;
}
ret = tplg_pp_add_object_tuple_section(tplg_pp, class_cfg, n, data_cfg_name,
token);
- free(data_cfg_name);
if (ret < 0) {
SNDERR("Failed to add data section %s\n", data_cfg_name);
+ free(data_cfg_name);
return ret;
}
+ free(data_cfg_name);
}
return 0;
return 0;
/* set class name as the name prefix for the object */
- snd_config_get_id(obj, &obj_id);
- snd_config_get_id(class_cfg, &class_id);
+ if (snd_config_get_id(obj, &obj_id) < 0)
+ return -EINVAL;
+ if (snd_config_get_id(class_cfg, &class_id) < 0)
+ return -EINVAL;
new_name = strdup(class_id);
if (!new_name)
return -ENOMEM;
default:
SNDERR("Argument '%s' in object '%s.%s' is not an integer or a string\n",
s, class_id, obj_id);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
/* alloc and concat arg value to the name */