]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootstd: Avoid showing an invalid buffer address
authorSimon Glass <sjg@chromium.org>
Sat, 19 Oct 2024 15:22:09 +0000 (09:22 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 4 Nov 2024 03:27:12 +0000 (21:27 -0600)
When the buffer address is not set, say so, rather than showing an
address which looks very strange, on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/bootflow.c

index 5b6e003df77a35621365bf532d5cda964e2609eb..f67948d73688a4fb0d3a2a30a2ca2b4c665e04bd 100644 (file)
@@ -393,7 +393,11 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc,
        printf("Partition: %d\n", bflow->part);
        printf("Subdir:    %s\n", bflow->subdir ? bflow->subdir : "(none)");
        printf("Filename:  %s\n", bflow->fname);
-       printf("Buffer:    %lx\n", (ulong)map_to_sysmem(bflow->buf));
+       printf("Buffer:    ");
+       if (bflow->buf)
+               printf("%lx\n", (ulong)map_to_sysmem(bflow->buf));
+       else
+               printf("(not loaded)\n");
        printf("Size:      %x (%d bytes)\n", bflow->size, bflow->size);
        printf("OS:        %s\n", bflow->os_name ? bflow->os_name : "(none)");
        printf("Cmdline:   ");