mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -05:00
add missing return value changes for snd_config_get_id() calls
Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
This commit is contained in:
parent
41039b49ad
commit
796b48c0d2
7 changed files with 18 additions and 9 deletions
|
|
@ -4437,7 +4437,8 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config,
|
|||
if (snd_config_search(root, fdriver, &n) >= 0) {
|
||||
if (snd_config_get_string(n, &driver) < 0) {
|
||||
if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND) {
|
||||
snd_config_get_id(n, &driver);
|
||||
if (snd_config_get_id(n, &driver) < 0)
|
||||
goto __err;
|
||||
goto __std;
|
||||
}
|
||||
goto __err;
|
||||
|
|
|
|||
|
|
@ -2578,8 +2578,8 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
|
|||
#endif
|
||||
if (snd_config_get_type(pcm_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
char *val;
|
||||
id = NULL;
|
||||
snd_config_get_id(pcm_conf, &id);
|
||||
if (snd_config_get_id(pcm_conf, &id) < 0)
|
||||
id = NULL;
|
||||
val = NULL;
|
||||
snd_config_get_ascii(pcm_conf, &val);
|
||||
snd_error(PCM, "Invalid type for PCM %s%sdefinition (id: %s, value: %s)", name ? name : "", name ? " " : "", id, val);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,8 @@ int tplg_parse_channel(snd_tplg_t *tplg, snd_config_t *cfg,
|
|||
return -EINVAL;
|
||||
|
||||
channel += tplg->channel_idx;
|
||||
snd_config_get_id(cfg, &id);
|
||||
if (snd_config_get_id(cfg, &id) < 0)
|
||||
return -EINVAL;
|
||||
tplg_dbg("\tChannel %s at index %d", id, tplg->channel_idx);
|
||||
|
||||
channel_id = lookup_channel(id);
|
||||
|
|
|
|||
|
|
@ -381,7 +381,8 @@ int tplg_parse_dapm_graph(snd_tplg_t *tplg, snd_config_t *cfg,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
snd_config_get_id(cfg, &graph_id);
|
||||
if (snd_config_get_id(cfg, &graph_id) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
snd_config_for_each(i, next, cfg) {
|
||||
const char *id;
|
||||
|
|
|
|||
|
|
@ -792,7 +792,8 @@ static int parse_tuple_set(snd_config_t *cfg,
|
|||
unsigned int tuple_val;
|
||||
int type, ival;
|
||||
|
||||
snd_config_get_id(cfg, &id);
|
||||
if (snd_config_get_id(cfg, &id) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
type = get_tuple_type(id);
|
||||
if (type < 0) {
|
||||
|
|
|
|||
|
|
@ -423,7 +423,10 @@ struct tplg_elem* tplg_elem_new_common(snd_tplg_t *tplg,
|
|||
|
||||
/* do we get name from cfg */
|
||||
if (cfg) {
|
||||
snd_config_get_id(cfg, &id);
|
||||
if (snd_config_get_id(cfg, &id) < 0) {
|
||||
free(elem);
|
||||
return NULL;
|
||||
}
|
||||
snd_strlcpy(elem->id, id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
|
||||
elem->id[SNDRV_CTL_ELEM_ID_NAME_MAXLEN - 1] = 0;
|
||||
/* as we insert new elem based on the index value, move index
|
||||
|
|
|
|||
|
|
@ -627,7 +627,8 @@ static int tplg_parse_streams(snd_tplg_t *tplg ATTRIBUTE_UNUSED,
|
|||
const char *id, *value;
|
||||
int stream;
|
||||
|
||||
snd_config_get_id(cfg, &id);
|
||||
if (snd_config_get_id(cfg, &id) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
tplg_dbg("\t%s:", id);
|
||||
|
||||
|
|
@ -750,7 +751,8 @@ static int tplg_parse_fe_dai(snd_tplg_t *tplg ATTRIBUTE_UNUSED,
|
|||
const char *id;
|
||||
unsigned int dai_id;
|
||||
|
||||
snd_config_get_id(cfg, &id);
|
||||
if (snd_config_get_id(cfg, &id) < 0)
|
||||
return -EINVAL;
|
||||
tplg_dbg("\t\tFE DAI %s:", id);
|
||||
snd_strlcpy(pcm->dai_name, id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue