21 Feb
2017
21 Feb
'17
2:43 p.m.
On Tue, 21 Feb 2017 15:34:44 +0100, Alan Young wrote:
- else if (snd_config_get_type(converter) == SND_CONFIG_TYPE_COMPOUND) {
snd_config_iterator_t i, next;
snd_config_for_each(i, next, converter) {
snd_config_t *n = snd_config_iterator_entry(i);
const char *id;
snd_config_get_id(n, &id);
if (strcmp(id, "name") != 0)
continue;
snd_config_get_string(n, &type);
break;
}
if (type) {
err = rate_open_func(rate, type, converter, 1);
}
The error handling is missing when no name is given. You should handle the error explicitly instead of the success.
if (!type) { SNDERR("No name is given for rate converter"); ..... return -EINVAL; }
err = rate_open_func(....);
Takashi