From patchwork Fri May 8 05:50:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 245299 List-Id: U-Boot discussion From: takahiro.akashi at linaro.org (AKASHI Takahiro) Date: Fri, 8 May 2020 14:50:18 +0900 Subject: [PATCH] cmd: efidebug: add a comment against Coverity check (300329) Message-ID: <20200508055018.7403-1-takahiro.akashi@linaro.org> The check here, "Null pointer dereferences," is a false positive. So leave a comment. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300329) --- cmd/efidebug.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 9769aeeac58b..70aba446a937 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -481,6 +481,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 < EFI_MAX_MEMORY_TYPE) type = efi_mem_type_string[map->type];