[Piglit] [PATCH] cl-api-create-program-with-binary: Match variable type in calloc.

Vinson Lee vlee at freedesktop.org
Sat Dec 20 00:30:27 PST 2014


Fix Clang Static Analyzer "Allocator sizeof operand mismatch" bug.

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

diff --git a/tests/cl/api/create-program-with-binary.c b/tests/cl/api/create-program-with-binary.c
index 4873b76..55457d9 100644
--- a/tests/cl/api/create-program-with-binary.c
+++ b/tests/cl/api/create-program-with-binary.c
@@ -101,7 +101,7 @@ static cl_program create_binary_program(const piglit_cl_context ctx)
 		goto free_sizes;
 	}
 
-	binaries = calloc(sizeof(char*),  ctx->num_devices);
+	binaries = calloc(sizeof(unsigned char*),  ctx->num_devices);
 	for (i = 0; i < ctx->num_devices; i++) {
 		binaries[i] = malloc(sizes[i]);
 	}
-- 
2.2.1



More information about the Piglit mailing list