]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
meminfo: correct "free" memory region size
authorShiji Yang <yangshiji66@outlook.com>
Sun, 27 Jul 2025 07:42:01 +0000 (15:42 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 7 Aug 2025 17:15:41 +0000 (11:15 -0600)
The size of free memory should be $lmb_base - $ram_base.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
cmd/meminfo.c

index acdb38dcba02ba492a9bb9afdb58e29ed5e9f764..aa3b5bafe176000da7e91a6eb424321858182832 100644 (file)
@@ -93,7 +93,7 @@ static int do_meminfo(struct cmd_tbl *cmdtp, int flag, int argc,
        print_region("stack", stk_bot, CONFIG_STACK_SIZE, &upto);
        if (IS_ENABLED(CONFIG_LMB))
                show_lmb(lmb_get(), &upto);
-       print_region("free", gd->ram_base, upto, &upto);
+       print_region("free", gd->ram_base, upto - gd->ram_base, &upto);
 
        return 0;
 }