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

Jan Vesely jan.vesely at rutgers.edu
Wed Dec 17 07:03:03 PST 2014


On Tue, 2014-12-16 at 22:47 -0800, Vinson Lee wrote:
> Fix Coverity "sizeof not portable" defect.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>

Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>

> ---
>  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);

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141217/e073d697/attachment.sig>


More information about the Piglit mailing list