ucm: find-device / pcm - the ctl_list may be empty

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-04-16 10:48:35 +02:00
parent 447a676ee5
commit ddb0871ec6

View file

@ -467,6 +467,10 @@ static int rval_device_lookup_init(snd_use_case_mgr_t *uc_mgr,
if (snd_config_search(config, "ctl", &d) || snd_config_get_string(d, &s)) {
iter->ctl_list = uc_mgr_get_master_ctl(uc_mgr);
if (iter->ctl_list == NULL) {
uc_error("Control device is not defined!");
return -EINVAL;
}
} else {
err = uc_mgr_open_ctl(uc_mgr, &iter->ctl_list, s, 1);
if (err < 0) {