]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: efidebug: fix a wrong handling of arguments
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Fri, 8 May 2020 05:50:47 +0000 (14:50 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 9 May 2020 07:30:27 +0000 (09:30 +0200)
Coverity detected a dead code, but actually there is a bug in a check
against a number of arguments. So simply fix it.

Reported-by: Coverity (CID 300330)
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/efidebug.c

index d8a76d78a38896727f70fb7947b417303654c0f7..5e3bf16573da184bb4b19bc5cac6a63de81c92b0 100644 (file)
@@ -602,7 +602,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];