Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/intel/xe_copy_basic: Fix validating the mem set values.
@ 2023-10-25  2:20 sai.gowtham.ch
  2023-10-25  4:08 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sai.gowtham.ch @ 2023-10-25  2:20 UTC (permalink / raw)
  To: igt-dev, sai.gowtham.ch

From: Sai Gowtham Ch <sai.gowtham.ch@intel.com>

Avoid crash by memory un mapping the dst.ptr after validating the set
values.

Signed-off-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
---
 tests/intel/xe_copy_basic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_copy_basic.c b/tests/intel/xe_copy_basic.c
index 059c54488..fe78ac50f 100644
--- a/tests/intel/xe_copy_basic.c
+++ b/tests/intel/xe_copy_basic.c
@@ -113,13 +113,14 @@ mem_set(int fd, uint32_t dst_handle, const intel_ctx_t *ctx, uint32_t size,
 	result = (uint8_t *)mem.dst.ptr;
 
 	intel_allocator_bind(ahnd, 0, 0);
-	munmap(mem.dst.ptr, size);
 	gem_close(fd, bb);
 	put_ahnd(ahnd);
 
 	igt_assert(result[0] == fill_data);
 	igt_assert(result[width - 1] == fill_data);
 	igt_assert(result[width] != fill_data);
+
+	munmap(mem.dst.ptr, size);
 }
 
 static void copy_test(int fd, uint32_t size, enum blt_cmd_type cmd, uint32_t region)
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-25 19:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-25  2:20 [igt-dev] [PATCH i-g-t] tests/intel/xe_copy_basic: Fix validating the mem set values sai.gowtham.ch
2023-10-25  4:08 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-10-25  5:56 ` [igt-dev] [PATCH i-g-t] " Kumar, Janga Rahul
2023-10-25 19:29 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox