]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: mbr: Unmap the buffers after use
authorSimon Glass <sjg@chromium.org>
Sun, 1 Sep 2024 22:26:31 +0000 (16:26 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 18 Sep 2024 19:01:00 +0000 (13:01 -0600)
This tests maps some local variables into sandbox's address space. Make
sure to unmap them afterwards.

Note that the normal approach with sandbox is to use a fixed memory
address in the RAM, to avoid needing to create a map for transient local
variables.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 04291ee0aba ("cmd: mbr: Allow 4 MBR partitions without need...")
test/cmd/mbr.c

index c38199740a3e2e29e23cbb74d13ea1b423271815..e750875ea43b00b3517b5222537acfa533c4e06e 100644 (file)
@@ -456,6 +456,9 @@ static int mbr_test_run(struct unit_test_state *uts)
                        "5P EBR+0x%04X: expected %#02X, actual: %#02X\n",
                        ebr_cmp_start + i, ebr_parts_ref_p5[i], rbuf[ebr_cmp_start + i]);
        }
+       unmap_sysmem(mbr_wbuf);
+       unmap_sysmem(ebr_wbuf);
+       unmap_sysmem(rbuf);
 
        return 0;
 }