diff mbox series

[v3,21/24] test: mbr: Unmap the buffers after use

Message ID 20240815202535.767869-22-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Fix various bugs | expand

Commit Message

Simon Glass Aug. 15, 2024, 8:25 p.m. UTC
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...")
---

Changes in v3:
- Add a Fixes tag

 test/cmd/mbr.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c
index 1a35ba3351c..8a4d61b2928 100644
--- a/test/cmd/mbr.c
+++ b/test/cmd/mbr.c
@@ -461,6 +461,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;
 }