OSDN Git Service

ucm: return error if fixedboot_list is empty
authorJaroslav Kysela <perex@perex.cz>
Tue, 13 Apr 2021 17:13:20 +0000 (19:13 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 13 Apr 2021 17:13:20 +0000 (19:13 +0200)
The application should know, that there is no special
initialization sequence. It's counterpart for
"ucm: return error if boot_list is empty".

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/main.c

index 3a56bce..04fffa8 100644 (file)
@@ -2234,6 +2234,8 @@ static int set_fixedboot_user(snd_use_case_mgr_t *uc_mgr,
                uc_error("error: wrong value for _fboot (%s)", value);
                return -EINVAL;
        }
+       if (list_empty(&uc_mgr->fixedboot_list))
+               return -ENOENT;
        err = execute_sequence(uc_mgr, &uc_mgr->fixedboot_list,
                               &uc_mgr->value_list, NULL, NULL);
        if (err < 0) {