From: Hui Wang Date: Thu, 29 Oct 2020 06:51:30 +0000 (+0800) Subject: ucm: return error if boot_list is empty X-Git-Tag: v1.2.5~52 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=2368a95b8f100e0b6fdb332a5118fe6e5af12fb6;p=alsa-lib.git ucm: return error if boot_list is empty If bootlist is empty, that means there is no BootSequence defined in the ucm for this sound card, let set_boot_user() return error, then alsactl could have chance to use non-ucm ways to initialize the sound card. BugLink: https://github.com/alsa-project/alsa-lib/pull/94 Signed-off-by: Hui Wang Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/main.c b/src/ucm/main.c index 18531c80..3a56bce4 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -2252,6 +2252,8 @@ static int set_boot_user(snd_use_case_mgr_t *uc_mgr, uc_error("error: wrong value for _boot (%s)", value); return -EINVAL; } + if (list_empty(&uc_mgr->boot_list)) + return -ENOENT; err = execute_sequence(uc_mgr, &uc_mgr->boot_list, &uc_mgr->value_list, NULL, NULL); if (err < 0) {