diff mbox series

cmd: efidebug: fix a wrong handling of arguments

Message ID 20200508055047.7453-1-takahiro.akashi@linaro.org
State Accepted, archived
Commit d67591dc22f9a6d41163fb6ba0efce5fa0598830
Delegated to: Heinrich Schuchardt
Headers show
Series cmd: efidebug: fix a wrong handling of arguments | expand

Commit Message

AKASHI Takahiro May 8, 2020, 5:50 a.m. UTC
Coverity detected a dead code, but actually there is a bug in a check
against a number of arguments. So simply fix it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reported-by: Coverity (CID 300330)
---
 cmd/efidebug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index 70aba446a937..56bf9af77248 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -606,7 +606,7 @@  static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag,
 				+ sizeof(struct efi_device_path); /* for END */
 
 	/* optional data */
-	if (argc < 6)
+	if (argc == 6)
 		lo.optional_data = NULL;
 	else
 		lo.optional_data = (const u8 *)argv[6];