mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
topology: next round of coverity fixes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
022c790aab
commit
c6e7fd8b1e
2 changed files with 7 additions and 5 deletions
|
|
@ -88,8 +88,7 @@ static int tplg_parse_data_file(snd_config_t *cfg, struct tplg_elem *elem)
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
SNDERR("error: invalid data file path '%s'\n",
|
SNDERR("error: invalid data file path '%s'\n",
|
||||||
filename);
|
filename);
|
||||||
ret = -errno;
|
return -errno;
|
||||||
goto err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek(fp, 0L, SEEK_END);
|
fseek(fp, 0L, SEEK_END);
|
||||||
|
|
@ -463,6 +462,7 @@ static int copy_tuples(struct tplg_elem *elem,
|
||||||
|
|
||||||
off = priv->size;
|
off = priv->size;
|
||||||
priv->size = size; /* update private data size */
|
priv->size = size; /* update private data size */
|
||||||
|
elem->data = priv;
|
||||||
|
|
||||||
array = (struct snd_soc_tplg_vendor_array *)(priv->data + off);
|
array = (struct snd_soc_tplg_vendor_array *)(priv->data + off);
|
||||||
array->size = set_size;
|
array->size = set_size;
|
||||||
|
|
@ -499,7 +499,6 @@ static int copy_tuples(struct tplg_elem *elem,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elem->data = priv;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,8 +253,10 @@ static int tplg_load_config(const char *file, snd_config_t **cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snd_input_close(in);
|
ret = snd_input_close(in);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
in = NULL;
|
||||||
goto err_load;
|
goto err_load;
|
||||||
|
}
|
||||||
|
|
||||||
*cfg = top;
|
*cfg = top;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -262,7 +264,8 @@ static int tplg_load_config(const char *file, snd_config_t **cfg)
|
||||||
err_load:
|
err_load:
|
||||||
snd_config_delete(top);
|
snd_config_delete(top);
|
||||||
err:
|
err:
|
||||||
snd_input_close(in);
|
if (in)
|
||||||
|
snd_input_close(in);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue