Skip to contentSkip to conversation

efi_loader: error handling for `efidebug boot add`

PATCH New Heinrich Schuchardt 2 participants 2 messages Feb 28, 2019 – Mar 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: error handling for `efidebug boot add`

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.

---
 cmd/efidebug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/efidebug.c +1 -1
index 5072a7b39bc..db96682c5a4 100644
@@ -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;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 efi_loader: error handling for `efidebug boot add`

Quoted 5 lines · Heinrich Schuchardt

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.

Alex

Quoted 17 lines
---
 cmd/efidebug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/efidebug.c +1 -1
index 5072a7b39bc..db96682c5a4 100644
@@ -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;