[Piglit] [PATCH] cl/api: Fix uninitialized read in cl/api/create_buffer.c

Aaron Watry awatry at gmail.com
Mon May 5 09:39:53 PDT 2014


valgrind was giving:
Conditional jump or move depends on uninitialised value(s)
    at 0x4023B8: piglit_cl_test (create-buffer.c:226)
    by 0x4E40CF2: piglit_cl_api_test_run (piglit-framework-cl-api.c:198)
    by 0x4E3FD1C: piglit_cl_framework_run (piglit-framework-cl.c:264)
    by 0x401E3B: main (create-buffer.c:47)

Test passes on evergreen before/after the change.

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 tests/cl/api/create-buffer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/cl/api/create-buffer.c b/tests/cl/api/create-buffer.c
index f660104..b42dcba 100644
--- a/tests/cl/api/create-buffer.c
+++ b/tests/cl/api/create-buffer.c
@@ -174,6 +174,10 @@ piglit_cl_test(const int argc,
 
 	/*** Normal usage ***/
 
+	for (i = 0; i < BUFFER_SIZE; i++){
+		host_buffer[i] = (unsigned char)i;
+	}
+
 	/*
 	 * For each memory flags mix.
 	 * There are 2^(num_mem_flags)-1 possible options without
-- 
1.9.1



More information about the Piglit mailing list