[Piglit] [PATCH] util-cl: Fix non-portable sizeof.

Vinson Lee vlee at freedesktop.org
Tue Dec 16 22:47:35 PST 2014


Fix Coverity "sizeof not portable" defect.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-framework-cl-program.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-cl-program.c b/tests/util/piglit-framework-cl-program.c
index d335486..f94525b 100644
--- a/tests/util/piglit-framework-cl-program.c
+++ b/tests/util/piglit-framework-cl-program.c
@@ -287,7 +287,7 @@ piglit_cl_program_test_run(const int argc,
 	} else if(config->program_binary_file != NULL) {
 		unsigned int length;
 		size_t* lengths = malloc(sizeof(size_t) * env.context->num_devices);
-		unsigned char** program_binaries = malloc(sizeof(unsigned char**) * env.context->num_devices);
+		unsigned char** program_binaries = malloc(sizeof(unsigned char*) * env.context->num_devices);
 
 		((char**)program_binaries)[0] =
 			piglit_load_text_file(config->program_binary_file, &length);
-- 
1.9.2



More information about the Piglit mailing list