]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: efidebug: add a comment against Coverity check (300329)
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Fri, 8 May 2020 05:50:18 +0000 (14:50 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 9 May 2020 07:30:28 +0000 (09:30 +0200)
The check here, "Null pointer dereferences," is a false positive.
So leave a comment.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reported-by: Coverity (CID 300329)
cmd/efidebug.c

index 5e3bf16573da184bb4b19bc5cac6a63de81c92b0..668e5c4e872e5c6f5dd0d11abb5f298fcca6767a 100644 (file)
@@ -480,6 +480,11 @@ static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag,
               EFI_PHYS_ADDR_WIDTH - 5, spc, EFI_PHYS_ADDR_WIDTH - 3, spc);
        printf("================ %.*s %.*s ==========\n",
               EFI_PHYS_ADDR_WIDTH, sep, EFI_PHYS_ADDR_WIDTH, sep);
+       /*
+        * Coverity check: dereferencing null pointer "map."
+        * This is a false positive as memmap will always be
+        * populated by allocate_pool() above.
+        */
        for (i = 0, map = memmap; i < map_size / sizeof(*map); map++, i++) {
                if (map->type < ARRAY_SIZE(efi_mem_type_string))
                        type = efi_mem_type_string[map->type];