efi_loader: error handling for `efidebug boot add`
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 28 Feb 2019 19:41:58 +0000 (20:41 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 2 Mar 2019 22:34:26 +0000 (23:34 +0100)
In  `efidebug boot add iPXE scsi 0:1 snp-arm64.efi --foo` a parameter is
missing. Hence the command should not silently return as if everything were
ok but should display the usage info.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
cmd/efidebug.c

index 5072a7b..db96682 100644 (file)
@@ -491,7 +491,7 @@ static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag,
 
        id = (int)simple_strtoul(argv[1], &endp, 16);
        if (*endp != '\0' || id > 0xffff)
-               return CMD_RET_FAILURE;
+               return CMD_RET_USAGE;
 
        sprintf(var_name, "Boot%04X", id);
        p = var_name16;