]> git.baikalelectronics.ru Git - uboot.git/commitdiff
cmd: undefined return value of do_extension_apply()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 11 Jul 2022 18:01:12 +0000 (20:01 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 4 Aug 2022 17:59:59 +0000 (13:59 -0400)
If 'extension apply all' is executed and no extension is found, the return
value of do_extension_apply() is undefined. Return CMD_RET_FAILURE in this
case.

Fixes: df8ed7996fb5 ("cmd: add support for a new "extension" command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
cmd/extension_board.c

index bbb4812ff81d6f4f56a9b1b1e78a57c64bb9d3e3..f94abd612d5e87677927779374d83dbd10a106c3 100644 (file)
@@ -111,6 +111,7 @@ static int do_extension_apply(struct cmd_tbl *cmdtp, int flag,
                return CMD_RET_USAGE;
 
        if (strcmp(argv[1], "all") == 0) {
+               ret = CMD_RET_FAILURE;
                list_for_each_entry(extension, &extension_list, list) {
                        ret = extension_apply(extension);
                        if (ret != CMD_RET_SUCCESS)